Hi All,
Does anyone have a script that could read into AD and export each user default SMTP email address with their full names to an Excel CSV or tab delimited file?
Thanks
Set oRS = oConnection.Execute("SELECT mail,uid,sn,givenName FROM 'LDAP://abg0970e.abg.fsc.net' WHERE uid='" & WshNetwork.Username & "'"
'While Not oRS.EOF
If oRS.RecordCount = 1 Then For i = 0 To oRS.Fields.Count - 1
If IsArray(oRS.Fields(i).value) Then
aArray = oRS.Fields(i).Value
If oRS.Fields(i).Name = "sn" Then
strSN = aArray(0)
ElseIf oRS.Fields(i).Name = "givenName" Then
strGN = aArray(0)
End If
'msgbox oRS.Fields(i).Name & ": " & aArray(0)
WshShell.RegWrite "HKCU\Software\WASP\NetWorker Laptop_6.2_EN\" & oRS.Fields(i).Name, aArray(0)
Else
If oRS.Fields(i).Name = "sn" Then
strSN = oRS.Fields(i)
ElseIf oRS.Fields(i).Name = "givenName" Then
strGN = oRS.Fields(i)
End If
'msgbox oRS.Fields(i).Name & ": " & oRS.Fields(i)
WshShell.RegWrite "HKCU\Software\WASP\NetWorker Laptop_6.2_EN\" & oRS.Fields(i).Name, oRS.Fields(i).Value
End If
Next
'oRS.MoveNext
WshShell.RegWrite "HKCU\Software\WASP\NetWorker Laptop_6.2_EN\commonNameNational", strGN & " " & strSN
Else
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.