[quote quote=222189]sfirita, welcome to Powershell.org. Please take a moment and read the very first post on top of the list of this forum: Read Me Before Posting! You’ll be Glad You Did!.
This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.
… and i’m kind of lost.
What exactly is it what you don’t understand? Please show your code – even if it does not work as you expect it or does not work at all.[/quote]
hello again,
thank you for your answer, yeah i know i didnt ask for a complete script
just wanted a way out that i can follow, i want to learn , and to do that i have to fail and retry
so this is my script, which is working fine to extract usersnwith selected attributes :
get-aduser -Server $Server -Filter * -SearchBase "OU=GROUPADMIN,OU=COUNTRY,OU=User-Accounts,DC=EM,DC=cab" -Properties Enabled, SamAccountName, createTimeStamp, Lastlogon, AccountExpires, DisplayName, LockedOut, Description, sn ,
givenName , CanonicalName, mail, Department, physicalDeliveryOfficeName, telephoneNumber, city, memberof |
select enabled, SamAccountName, createtimestamp, @{Name=”LastLogon”;Expression={[DateTime]::FromFileTime($_.lastlogon)}}, @{Name=”accountexpires”;Expression={[DateTime]::FromFileTime($_.accountexpires)}},
DisplayName, LockedOut, Description, sn , givenName , CanonicalName, mail, Department, physicalDeliveryOfficeName, telephoneNumber, city, @{Label="DA";Expression={If($_.MemberOf -join "" -match "CN=Domain Admins,"){"Yes"}Else{"No"}}} | Out-GridView -OutputMode Single
what i want is a way to add another column, where based on the samaccountname i can have the sameaccountnames with a “_a” tag in the end, cause as i explained, we have different admin accounts for the same SAN , differentiated with the “_a” . i hope i explained well my problem, english is not my native language.