Reputation: 52
Before I got into my position someone had created a field for our users called PCN, This held some information for where the user was located and what PC they where assigned to. This is all fine and good but they use this .vbs to edit this field in AD.
Dim objEmployeeNumber
Dim objSelectedUser
Dim strNewEmployeeNumber
Set objEmployeeNumber = Wscript.Arguments
Set objSelectedUser = GetObject(objEmployeeNumber(0))
strNewEmployeeNumber = InputBox("Employee PCN: " & objSelectedUser.employeeNumber & vbCRLF _
& vbCRLF _
& "To enter a new Employee PCN," _
& " type it into the text box" _
& " below and click OK.")
if strNewEmployeeNumber <> "" then objSelectedUser.Put "employeeNumber",strNewEmployeeNumber
objSelectedUser.SetInfo
WScript.Quit
I am trying to streamline all the AD editing the Helpdesk does into a single PowerShell script since it would run from our ticketing software but I have no idea how to add this Employee PCN information in. (Relatively new to PowerShell as well)
Can anyone make sense of this to know how I could add this information in using PowerShell instead of this .vbs?
Upvotes: 1
Views: 51
Reputation: 52
Derived with assistance from Austin French I used the Get-ADUser (Account) -properties * | Select * To show all the properties and found it, I was then able to add it like all my other items. Thanks for your assistance Austin French!
Upvotes: 1