Friday, July 22, 2011

Modify Logon Scirpt (scriptPath)–PowerShell

Here are a couple of options to modify the Logon Script (scriptPath) value in Active Directory. This script requires PowerShell Active Directory module. 

Remove scriptPath Value

Import-module ActiveDirectory
Get-ADUser -Filter * -SearchBase "OU=User Accounts,DC=santhosh,DC=lab" | Set-ADUser -Clear scriptPath

Update or set scriptPath Value

Import-module ActiveDirectory
Get-ADUser -Filter * -SearchBase "OU=User Accounts,DC=santhosh,DC=lab" | Set-ADUser –scriptPath “\\San01\test.bat”

 

More scripts - http://portal.sivarajan.com/search?q=script+powershell&max-results=20

http://gallery.technet.microsoft.com/scriptcenter/site/profile?userName=Santhosh%20Sivarajan-

1 comments:

Dear Sir, pretty awesome. Exactly what I need. Thank you so much and best Regards from Switzerland - Greg

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More