Link to home
Start Free TrialLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Automate PC's, Laptop to correct OU

Hi,

We have recently installed Quest Active Acroles and there is a way of automatically placing laptops and PCS to the correct OU's. Example we have laptops with the naming convention LP-LON-01, LP means it is a laptop and LON means it is based in London therefore this machine should be placed in the London laptop OU. How do we achieve this. Is there a script any one have in order to do this so that  we may then import this script as a module on active roles.

Thank you in advance.

kelly
Avatar of Joseph Moody
Joseph Moody
Flag of United States of America image

You can use PowerShell to do this. Here is a guide that I put together a few years ago. It uses the Quest AD cmdlets but you can also use the native AD cmdlets if you wish:

https://deployhappiness.com/move-computer-to-ou-based-on-name-automatically/

Let me know if you have any issues.
Avatar of Kelly Garcia

ASKER

there is an onpostcreate script module on active roles, when I import that module it gives me

function onPostCreate($Request)
{



}

Open in new window


so my thoughts right now are:

function onPostCreate($Request)
{

if (Get-QADComputer $request| ? {$_.name -like 'lp-lon*'})
{
#move to London OU

}

}

Open in new window


not sure if this will work.

regards,
kay User generated imageUser generated image
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Fantastic!