0 votes

How do I rename an AD Object?

When I try Rename-ADObject or use the ADAxes equivilent I get the follow error. It then references the CSV Import line for some reason.

    The object already exists.  Stack trace: at <ScriptBlock>, <No file>: line 841 at <ScriptBlock>, <No file>: line 410

If I run the script outside ADAxes, it completes without error and makes the expected changes.

Thanks

by (40 points)
edited by
0

Hello,

How do I rename an AD Object?

There are multiple approaches for renaming Active Directory objects via Adaxes. For examples, take a look at the following SDK articles: http://adaxes.com/sdk/WritingAdsiScripts/#renaming-objects; http://adaxes.com/sdk/Rename-AdmObject/.

When I try Rename-ADObject or use the ADAxes equivilent I get the follow error. It then refernces the CSV Import line for some reason.

Could you, please, send us (support[at]adaxes.com) the script used in Adaxes in TXT format and the CSV file you are using?

0

Either Rename command gives an error:

Rename-ADObject -Identity $DSName -NewName $DisplayName

OR

Rename-AdmObject -Identity $DSName -NewName $DisplayName

This is the CSV Input command:

Import-Csv -Path $InputFilePath | ForEach-Object {

Format:

USER_NAME,SUPR_USER_NAME,JOB_TITLE,DEPARTMENT,FIRST_NAME_NICK_NAME,MIDDLE_INITIAL,LAST_NAME_SUFFIX,EMP_NUM,DIVISION,WORK_PHONE,WORK_FAX1,WORK_FAX2,CELL_PHONE,IP_PHONE,PAGER,LOCATION,E_MAIL_ADDR,WORK_ADDR1,WORK_ADDR2,MAIL_STOP,CITY,STATE,ZIP,MAIL_VALUES,TERM_DATE CLS6,RDP6,Sr Project Manager,"Project Management",Cheryl,,Smith,11102,Corporate,702-555-1212,702-555-1212,,702-555-1212,73555,,LV-Spring Mtn,TST_CHERYL.SMITH@EMAIL.COM,5241 Spring Mountain Road,,LVC-480,Las Vegas,NV,89150, , NPL1,SRV2,Sr Security Analyst,"Cybersecurity Services",Nicolas,,Jones,11105,Corporate,702-555-1212,702-555-1212,,702-555-1212,73555,,LV-Spring Mtn,TST_NICOLAS.JONES@EMAIL.COM,5241 Spring Mountain Road,,LVC-340,Las Vegas,NV,89150, ,

0

Hello,

Thank you for the provided files. Could you, please, clarify whether the error occurs for all the accounts specified in the CSV file or only for specific ones? If latter is the case, does the sample you provided include the records the error occurs for? Do we understand correctly that the script is executed in Adaxes using the Run a program or PowerShell script action? If we do, please, clarify whether the script is executed as External program (e.g. .PS1) or as PowerShell script. image.png

A screenshot of the error would be also appreciated.

Please log in or register to answer this question.

Related questions

0 votes
1 answer

Hi: I am trying to create a business rule that will stop a value change based on the existing value. For example, if the telephonenumber is 1234 for a group and has to ... the value it uses is the incoming value of the change, not the existing value. Thanks!

asked Jun 3, 2022 by crobitaille (80 points)
0 votes
1 answer

Hi, I try to make a report for our SAM to show all users with a specific license. But I fail to even find anything. I tried, among many ... .DirectorySearcher.AppendFilter("(adm-O365AccountLicenses=POWER_BI_STANDARD)") But I get nothing. Please advice.

asked May 20, 2021 by KristofferJ (80 points)
0 votes
1 answer

We're needing to add some input masking for values. One such value is a date that must be in the format "YYYY-MM-DD HH:MM:SS" and a phone number that must be "(000) ... 't find one. Any ideas? I appologize if this is already somewhere but I couldn't find it.

asked Mar 15, 2021 by jordan (110 points)
0 votes
1 answer

This is what I need to accomplish. Day one, I perform an export of the following four attributes for all Users in AD - DN, employeeID, telephoneNumber, location. Day 2, ... in which one of them has changed. It possible to achieve this using a scheduled task?

asked Mar 23, 2015 by sbanks (270 points)
0 votes
1 answer

Occationally Service Desk staff need to clear a DNS record when a desktop has been reimaged but is keeping the same name as loses the ability to manage its original DNS ... running in ADAXES. Can I just install the applet on the ADAXES server using powershell?

asked Jan 17, 2023 by stevehalvorson (110 points)
3,541 questions
3,232 answers
8,225 comments
547,805 users