![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | vbscript AD and who create account Hello Im usign this script On Error Resume Next sciezka = InputBox ("Podaj sciezke gdzie chcesz zapisac plik *.txt?:"&VBCRLF& "np : c:\plik.txt") strOutputFile = sciezka Set objFileSystem = CreateObject("Scripting.fileSystemObject") Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE) 'strDomain = InputBox ("Podaj nazwe dmeny z której chcesz wyciagn±ć informacje?:") Const ADS_SCOPE_SUBTREE = 2 Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Provider = "ADsDSOObject" objConnection.Open "Active Directory Provider" Set objCommand.ActiveConnection = objConnection objCommand.Properties("Page Size") = 1000 objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE objCommand.CommandText = _ "SELECT ADsPath FROM 'LDAP://dc=,dc=' WHERE objectCategory='user'" Set objRecordSet = objCommand.Execute objRecordSet.MoveFirst Do Until objRecordSet.EOF strPath = objRecordSet.Fields("ADsPath").Value Set objUser = GetObject(strPath) objOutputFile.Write "Pelna nazwa: " & objUser.FullName &VBCRLF objOutputFile.Write "Uzytkownik: " & objUser.sAMAccountName &VBCRLF objOutputFile.Write "Konto utworzone: " & objUser.whenCreated & " GMT" &VBCRLF objOutputFile.Write "Wylaczone?: " & objUser.accountDisabled &VBCRLF objOutputFile.Write "----------------------------------"&VBCRLF objRecordSet.MoveNext Loop wscript.echo "Gotowe!" objOutputFile.Close To retrive info about users in domain but can i rerive info who create user? Pls help |
My System Specs![]() |
| | #2 (permalink) |
| | Re: vbscript AD and who create account "hehehehe" <ehhehe@xxxxxx> wrote in message news:gbvp63$14ve$1@xxxxxx Quote: > Hello Im usign this script > > On Error Resume Next > > sciezka = InputBox ("Podaj sciezke gdzie chcesz zapisac plik > *.txt?:"&VBCRLF& "np : c:\plik.txt") > strOutputFile = sciezka > Set objFileSystem = CreateObject("Scripting.fileSystemObject") > Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE) > > 'strDomain = InputBox ("Podaj nazwe dmeny z której chcesz wyciagn±ć > informacje?:") > > Const ADS_SCOPE_SUBTREE = 2 > > Set objConnection = CreateObject("ADODB.Connection") > Set objCommand = CreateObject("ADODB.Command") > objConnection.Provider = "ADsDSOObject" > objConnection.Open "Active Directory Provider" > Set objCommand.ActiveConnection = objConnection > > objCommand.Properties("Page Size") = 1000 > objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE > > objCommand.CommandText = _ > "SELECT ADsPath FROM 'LDAP://dc=,dc=' WHERE objectCategory='user'" > Set objRecordSet = objCommand.Execute > > objRecordSet.MoveFirst > > Do Until objRecordSet.EOF > strPath = objRecordSet.Fields("ADsPath").Value > Set objUser = GetObject(strPath) > objOutputFile.Write "Pelna nazwa: " & objUser.FullName &VBCRLF > objOutputFile.Write "Uzytkownik: " & objUser.sAMAccountName &VBCRLF > objOutputFile.Write "Konto utworzone: " & objUser.whenCreated & " GMT" > &VBCRLF > objOutputFile.Write "Wylaczone?: " & objUser.accountDisabled &VBCRLF > objOutputFile.Write "----------------------------------"&VBCRLF > objRecordSet.MoveNext > Loop > > wscript.echo "Gotowe!" > > > > objOutputFile.Close > > > > > To retrive info about users in domain but can i rerive info who create > user? > > Pls help only way to get this information would be to turn on auditing and read the logs. -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
| | #3 (permalink) |
| | Re: vbscript AD and who create account Thx regards MJ. |
My System Specs![]() |
| | #4 (permalink) |
| | Re: vbscript AD and who create account On Oct 2, 9:03*am, "hehehehe" <ehh...@xxxxxx> wrote: Quote: > Thx > > regards MJ. comp then look at the security on the object, you will find your username with full control |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| how to create a tunnel vpn with vbscript? | VB Script | |||
| Create tables with vbscript. | VB Script | |||
| Create vbscript to empty secure temp folder when exiting Outlook. | VB Script | |||
| how to create checkbox using vbscript | VB Script | |||
| vbscript to create file | Vista General | |||