script to remove logon scripts from AD profile
a powershell script similar vbscript solution posted in other forum follows. partially tested:
$ads_property_clear = 1
$ou = [adsi]"ldap://ou=west,dc=mydomain,dc=com"
function clearscriptpath($parent)
{
foreach ($child in $parent.get_children())
{
if ($child.class -eq "user")
{
$child.putex($ads_property_clear, "scriptpath", 0)
$child.setinfo()
}
if ($child.class -eq "organizationalunit")
{
clearscriptpath $child
}
}
}
clearscriptpath $ou
-----
richard mueller - mvp directory services
Windows Server > Windows PowerShell
Comments
Post a Comment