HTA/VBS Noob question
Posted: Mon Aug 16, 2010 5:45 am
Please post teh exact vbscript you aretrying to run. I need to see it. It is clear that you are no understanding what we need to do.
This script is what you need to edit to put in the sUser name between the quotes. It needs to be an actual CN name of a user. The rest of the script that adds the user to groups is your script and domain. If it is giving an error there you need to fix that too.
Of the LDAP string is incorret then you need to correct that. I cannot know what your domain looks like.
When you have edited and tested this post the exact script you have used along with teh exact error message in it's entirety. All words and numbers in the error message. You can just copy it from the console Window to the clipboard and past it into a message.
This script is what you need to edit to put in the sUser name between the quotes. It needs to be an actual CN name of a user. The rest of the script that adds the user to groups is your script and domain. If it is giving an error there you need to fix that too.
Of the LDAP string is incorret then you need to correct that. I cannot know what your domain looks like.
Code: Select all
sUser = "blah, blah" ' replace balh blah with a user CN.
'ProcessUser sUser
'ProcessUser "" & sUser & ""
Function ProcessUser( strUser, strOU )
'Add User to Group
strUserDN = Replace("LDAP://CN=XXXXX,OU=Standard,OU=Managed Users,DC=MFI,DC=domain,DC=PVT","XXXXX", strUser )
Set objUser = GetObject(strUserDN)
Set objGroup = GetObject("LDAP://CN=TSM_BackupUsers,OU=Application Rights, OU=Groups, OU=Managed Users,DC=MFI,DC=domain,DC=PVT")
objGroup.add objUser.ADsPath
Set oGrp = GetObject("WinNT://./Power Users")
set oGrp1 = GetObject("WinNT://./Backup Operators")
Set oUsr = GetObject("WinNT://MFI.domain.pvt/Domain Users")
oGrp.Add oUsr.ADsPath
oGrp1.Add oUsr.ADsPath
ProcessUser = true
End Function
When you have edited and tested this post the exact script you have used along with teh exact error message in it's entirety. All words and numbers in the error message. You can just copy it from the console Window to the clipboard and past it into a message.