Hallo, I am Powershell beginner. I need your valuable help with this. I need to be at the startup of the computer.
Restarting OpenVPN ->
Check if it is in the domain ->
if so, then disconnect OpenVPN. ->
if not, openvpn connect.
So far I have this
$SysInfo = New-Object -ComObject “ADSystemInfo”
Try {
$UserDN = $SysInfo.GetType().InvokeMember(“ComputerName”, “GetProperty”, $Null, $SysInfo, $Null)
“Connected”
}
Catch {
“Not connected”
}
Its check for domain connecting.