Yes, the easiest way to do so is as TheCleaner mentioned. Otherwise, try the following script: In this script, change the OU name to the one where your users exist. If your users are in default location, change it to "CN=Users," otherwise the required OU.
'---------------COPY FROM HERE---------------
Dim oRootDSE ,oDomain ,obj, objUser, oConnection, oCommand
Dim RS, strQuery, strAlias, varDomainNC
Const ADS_PROPERTY_CLEAR = 1
On Error Resume Next
Set oRootDSE = GetObject("LDAP://RootDSE"
varDomainNC = oRootDSE.Get("defaultNamin
set oConnection = CreateObject("ADODB.Connec
oConnection.Open "Provider=ADsDSOobject;"
varOU = "OU=Temp,"
strQuery = "<LDAP://" & varOU & varDomainNC & ">;(objectclass=user);adsp
set oCommand = CreateObject("ADODB.Comman
oCommand.ActiveConnection = oConnection
oCommand.CommandText = strQuery
Set RS = oCommand.Execute
wscript.echo RS.RecordCount & " users found"
If RS.RecordCount = 0 Then
wscript.echo strAlias, "There are no users"
Else
While Not RS.EOF
Set objUser = GetObject(RS.Fields("adspa
wscript.echo "Alias: " & objUser.name
objUser.PutEx ADS_PROPERTY_CLEAR, "profilePath", 0
objuser.setinfo
RS.MoveNext
Wend
wscript.echo "Profile Clear Completed"
obj = Nothing
objUser = Nothing
End If
oRootDSE = Nothing
oDomain = Nothing
Set oConnection = Nothing
Set oCommand = Nothing
Set RS = Nothing
'-------------SCRIPT ENDS--------------
Main Topics
Browse All Topics





by: TheCleanerPosted on 2006-02-24 at 13:52:37ID: 16042736
So you want to get rid of their login scripts completely in their AD profiles?
Why don't you just do it manually in AD?
Run a "query" in ADUC for all users that you want (in the query window), and then select them all and choose properties. Then choose the profile tab, check the "Login script" box and set the field to blank.