I am a newbie with powershell and struggling with this, What I need is to run a powershell script daily that will look into a single security group and export that data into a csv file that I will send to 3rd party. This csv file needs 8 columns starting with Site, Username, EmployeeID, FirstName, MiddleName, LastName, Organization, EmailAddress
That first column named "Site" has to be have this in each row "iBASEt" exactly just like you see lowercase i and then uppercase BASE and lowercase t and this value is in every ad objects Company field under Organization tab.
the next column Username has to be the users email address, EmployeeID needs to be something unique for every user, not sure what can be used, maybe users sid objectSID? the next column needs to be users first name then middle name in the next column, last name, then Organization, then email address in the next column. so far I have the following script that gets me only 1 column in the csv file and the column title is samaccountname which is the users username from AD, I need the email address of that user to be in the UserName column of this CSV file
This is my script below, please help a newbie?
Get-ADGroupMember -identity “PortalMembersLMS” | select samaccountname | Export-csv -path C:\Output\PortalMembersLMS.csv