-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1a.ps1
40 lines (33 loc) · 1.61 KB
/
1a.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$API_Key = "XjQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1M3gyeXNINF"
$API_Password = "XDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXWJkSPaeX"
$login_json = '{
"action":"login",
"param":{
"apikey":"XjQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1M3gyeXNINF",
"apipassword":"XDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXWJkSPaeX",
"customernumber":"00000"
}
}'
$login_Invoke = Invoke-RestMethod -Uri "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON" -Method Post -ContentType "application/json" -Body $login_json -SessionVariable Session_Login -OutVariable Out_Login
$apisessionid = $login_Invoke.responsedata.apisessionid
$infoDnsRecords_json = '{
"action":"infoDnsRecords",
"param":{
"domainname":"yourdomainhere.de",
"customernumber":"00000",
"apikey":"XjQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1M3gyeXNINF",
"apisessionid":"' + $apisessionid + '"
}
}'
$infoDnsRecords_Invoke = Invoke-RestMethod -Uri "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON" -Method Post -ContentType "application/json" -Body $infoDnsRecords_json -SessionVariable Session -OutVariable Out
$infoDnsRecords_Invoke.responsedata.dnsrecords
$logout_json = '{
"action":"logout",
"param":{
"customernumber":"00000",
"apikey":"XjQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1M3gyeXNINF",
"apisessionid":"' + $apisessionid + '"
}
}'
$logout_Invoke = Invoke-RestMethod -Uri "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON" -Method Post -ContentType "application/json" -Body $logout_json -SessionVariable Session_Logout -OutVariable Out_Logout
$logout_Invoke.responsedata