Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Really Hard Scripting

HTVi
TV Discussion Newsgroups

Really Hard Scripting
gbrown135 6/12/2007 2:54:01 PM
Still a vbs beginner and been struck with a major scripting task
The script I need to write is as follows:
1. I need to prompt for a netbios name. When entered it will remove them
from all the groups they are in in the Active Directory Member Of tab.
2.Once this is done then it will search the user's Attributes and find the
Profile Path, Home Drive Path and Terminal Services Profile Path. Thiw will
then delete these file's on the server's.
3. Once Deleted It will remove the Profile Paths, Home Drive Paths and
Terminal Services Profile Path from within the Active Directory Attributes..

I have the first bit now but need help with the rest:

Const ForReading = 1
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
Const ADS_PROPERTY_DELETE = 4

strUser = InputBox("Enter User Name")

strDomain = "My Domain"

Set objTrans = CreateObject("NameTranslate")

objTrans.Init ADS_NAME_INITTYPE_GC, ""

objTrans.Set ADS_NAME_TYPE_NT4, strDomain & "\" & strUser

strUserDN = objTrans.Get(ADS_NAME_TYPE_1779)

Set objUser = GetObject("LDAP://" & strUserDN)

arrMemberOf = objUser.GetEx("memberOf")

For Each Group in arrMemberOf
Set objGroup = GetObject("LDAP://" & Group)
objGroup.PutEx ADS_PROPERTY_DELETE, _
"member", Array("strUserDN")
objGroup.SetInfo

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen