0 votes

Hi,

I was was wondering if I could request a new feature for the next incarnation of adaxes...

Renaming a computer account from the Console - We have some successes with running the powershell script from this page : http://www.hofferle.com/rename-computer ... owershell/ . I was wondering if there was the possibility of integration of such a facility in the next version?

Many thanks,

Jay

by (90 points)

1 Answer

0 votes
by (216k points)

Hello Jay,

Microsoft does not recommend renaming computers joined to an AD domain remotely. For example, in the description of the Rename method of the Win32_ComputerSystem class that is used in the script it is clearly stated that "... you cannot use the method remotely for domain computers". For details, see http://msdn.microsoft.com/en-us/library ... 85%29.aspx. For this purpose, we decided not to provide the Rename functionality for computers in Adaxes.

However, if you want to go with the script that you provided, you can, for example, create a Business Rule that calls the script after modifying a certain property of the computer in Adaxes. The Business Rule will set the computer name to the value of the property with the help of the script. For this purpose, you can use one of Adaxes virtual properties, for example, CustomAttributeText1. Such properties are not stored in AD, but you can use them as any other properties of AD objects. To create such a Business Rule:

  1. Create a new Business Rule.

  2. On the 2nd step of the Create Business Rule wizard, select Computer and After Updating a Computer.

  3. On the 3rd step, add the Run a program or PowerShell script action and paste the following script in the Script field:

     Get-WmiObject Win32_ComputerSystem -ComputerName '%cn%' -Authentication 6 | ForEach-Object {$_.Rename('%adm-CustomAttributeText1%', $Context.RunAs.UserName, $Context.RunAs.Password)}
     Get-WmiObject Win32_OperatingSystem -ComputerName '%cn%' | ForEach-Object {$_.Win32Shutdown(6)}
    
  4. The script requires credentials of a user with sufficient permissions to change a computer name. The credentials are passed to the script from the Run As parameters of the action. To provide the credentials:

    • Switch the radio button in the Run as section to This account.
    • Click the associated Specify button and specify the credentials.
  5. Enter a short description for the script and click OK.

  6. Right-click the action and click Add Condition.

  7. Select the If <property> changed condition.

  8. Expand the <property> drop-down list.

  9. Select the CustomAttributeText1 property.

  10. Select has changed.

  11. Click OK and finish creation of the Business Rule.

Now, whenever you change the value of the CustomAttributeText1 property for a computer, the Business Rule will launch the script and will try to rename the computer to the name that you specified in the CustomAttributeText1 property.

0

Thank you.

I wasn't expecting that reply, and I have taken stock of your reasons for not implementing the feature.

Thanks for the feedback! :D

Jay

Related questions

0 votes
1 answer

I have a specific computer property pattern for three different types of computers, which live in three different OUs and are in three different business units. I will have ... How do I enforce a property pattern for a specific business unit at creation time?

asked Jul 17, 2023 by bennett.blodinger (60 points)
0 votes
1 answer

I would like to know if it is possible to create a field in the web UI under user management to "assign" a machine to a user. I would like to be able to put the ... be moved to "workstation OU. Is there s custome field that can be used to accomplish this?

asked Oct 22, 2020 by copatterson (70 points)
0 votes
1 answer

Hi! Can ADAxess be used to populate a AD group with computer objects who's name partly matches a AD username from another group? I'e let say we have a group named ' ... channel until problem is solved by just adjusting which group they belong to .... /Kaj

asked Jun 12, 2018 by KajLehtinen (650 points)
0 votes
1 answer

Hello all, I'm sure this is possible, but I'm confused on a few points. I'm trying to set up the security role and matching homepage action that will allow a user ... I'd like to use the least amount of permissions possible, just for security's sake. Thanks!

asked Jan 18, 2017 by ctdhelpdesk (190 points)
0 votes
0 answers

I am unable to move computer objects from any computer OU to another. I receive an access denied error when I try. I am able to delete computers that have ... listed in the topic Permissions Required to move Computers. Any assistance would be helpful. Mark

asked Oct 26, 2016 by mreny (40 points)
3,549 questions
3,240 answers
8,232 comments
547,814 users