Uderc programming article aggregator sites

Powershell Convert CSV TO Excel showing Wrong Data

Advertisement
Turns out Cduff was right it was a UFWE been a long day!! thanks guys especially for the other bits also
Advertisement
The best answer: Text############ Script name############# AD search$AD = "OU=STF,OU=Staff,OU=Accounts,DC=Domain,DC=ac,DC=uk"$Fields = "sAMAccountName","physicalDeliveryOfficeName","Displayname","GivenName", "Surname","Mail","Manager","Title","Department","Description","telephoneNumber","Departmentnumber","PostOfficeBox","Company","Postalcode"[email protected]{Name="Person_Code";Expression={$_.postofficebox[0]}}[email protected]{Name="First_Name";Expression={$_.GivenName}}$Surname="SurName"$Username = @{Name="UserName";Expression={$_.sAMAccountname}}[email protected]{Name="EMail";Expression={$_.Mail}}[email protected]{Name='Manager';Expression={(Get-Aduser -Identity $_.Manager -properties DisplayName).Displayname}}$Title="Title"$Dept="Department"[email protected]{Name="Team";Expression={$_.Company}}$Ext = @{Name="Ext";Expression={$_.telephoneNumber}}...
This topic first appeared in the Spiceworks Community