Learn when you want, where you want with convenient online training courses. Sign up now!
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
get-qaduser -sizelimit 0 -ldapfilter "(proxyAddresses=*@domainB.com)" -IncludedProperties proxyAddresses | select samaccountname,displayname,proxyAddresses | export-csv c:\temp\Aliasinfo.csv
Open in new window
Administration of Active Directory does not have to be hard. Too often what should be a simple task is made more difficult than it needs to be.The solution? Hyena from SystemTools Software. With ease-of-use as well as powerful importing and bulk updating capabilities.
get-qaduser -sizelimit 0 -ldapfilter "(proxyAddresses=*@domainB.com)" -IncludedProperties proxyAddresses | select samaccountname,displayname,proxyAddresses | out-file c:\temp\aliasinfo.txt -width 1000
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
Const FILE_NAME = "Users.csv"
Const LDAP_FILTER = "(proxyAddresses=*@domainB.com)"
Dim objConnection : Set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Dim objCommand : Set objCommand = Createobject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
Dim objRootDSE : Set objRootDSE = GetObject("LDAP://RootDSE")
objCommand.CommandText = "<LDAP://" & objRootDSE.Get("defaultNamingContext") & ">;" & _
LDAP_FILTER & ";name,sAMAccountName,mail,proxyAddresses;subtree"
Dim objRecordSet : Set objRecordSet = objCommand.Execute
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objFile : Set objFile = objFSO.OpenTextFile(FILE_NAME, 2, True, 0)
Do Until objRecordSet.EOF
objFile.WriteLine objRecordSet.Fields("Name").Value & "," & _
objRecordSet.Fields("SamAccountName").Value & "," & _
objRecordSet.Fields("mail").Value & "," & _
Join(objRecordSet.Fields("proxyAddresses").Value, " ")
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.