Edward Pamias
asked on
Powershell Script modification - I need this script to prompt for ID and password.
I found a script that can disable IPV6 remotely but due to some rules I am not allowed to save my ID and password in a file. Can some one modify this powershell script to prompt me for ID and password?
$adminPwd = "PASSWORD"
$compName = "REMOTECOMPUTERNAME"
$secPwd = ConvertTo-SecureString $adminPwd -AsPlainText -Force
$remoteCreds = New-Object System.Management.Automati on.PSCrede ntial ($adminUser, $secPwd)
$ServerSession = New-PSSession -ComputerName $compName -Authentication CredSSP -Credential $remoteCreds
Invoke-Command -Session $ServerSession -ScriptBlock
{
# Disable IPv6
$regPath = "HKLM:\SYSTEM\CurrentContr olSet\Serv ices\Tcpip 6\Paramete rs"
New-ItemProperty -Path $regPath -Name "DisabledComponents" -Value "0xFFFFFFFF" -PropertyType "DWORD" | Out-Null
Restart-Computer -ComputerName $env:computername -Force
}
$adminPwd = "PASSWORD"
$compName = "REMOTECOMPUTERNAME"
$secPwd = ConvertTo-SecureString $adminPwd -AsPlainText -Force
$remoteCreds = New-Object System.Management.Automati
$ServerSession = New-PSSession -ComputerName $compName -Authentication CredSSP -Credential $remoteCreds
Invoke-Command -Session $ServerSession -ScriptBlock
{
# Disable IPv6
$regPath = "HKLM:\SYSTEM\CurrentContr
New-ItemProperty -Path $regPath -Name "DisabledComponents" -Value "0xFFFFFFFF" -PropertyType "DWORD" | Out-Null
Restart-Computer -ComputerName $env:computername -Force
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help.
Why are you disabling IPv6?
ASKER
As per my comment above the 3rd level team told us to do it. I am not sure how this fixes our problem with Office 365 not seeing an internet connection, but it does. And these is over VPN, when they are in the office its fine.
No comment above about Office.
I would not disable it and Microsoft directly advises against it. Can you please elaborate on the Office 365 not seeing an internet connection, if you want...
I would not disable it and Microsoft directly advises against it. Can you please elaborate on the Office 365 not seeing an internet connection, if you want...
ASKER
All depends on the user. One person could get activation screen another person could have a triangle on the top right next to their login and both users Office does not see the network. Any ideas?
ASKER
One thing I forgot, this only happens at home while on VPN.
Some suggestions including activation errors during VPN
https://blogs.technet.microsoft.com/office_integration__sharepoint/2014/03/11/office-2013-can-not-check-in-files-when-lan-does-not-have-internet-access-or-over-some-vpns/
https://answers.microsoft.com/en-us/msoffice/forum/all/office-365-proplus-2013-fails-activation-when/b46cd39e-47df-4cb1-a244-79cd32077671?auth=1
https://blogs.technet.microsoft.com/office_integration__sharepoint/2014/03/11/office-2013-can-not-check-in-files-when-lan-does-not-have-internet-access-or-over-some-vpns/
https://answers.microsoft.com/en-us/msoffice/forum/all/office-365-proplus-2013-fails-activation-when/b46cd39e-47df-4cb1-a244-79cd32077671?auth=1
ASKER
Shaun, I like the bottom link that is something we did not try. The top link never worked for me. I will reply back later in the week and let you know how it goes.
ASKER