Hi
I am new to scripting and would like be able to move computer objects within AD based on there IP address?
Example:
192.168.1.1 -> 1st Floor OU
192.168.2.1 -> 2nd Floor OU
Etc...
I have already got a moving script which works great, but this needs me to manually enter the computer name?
Set objNewOU = GetObject("LDAP://OU=2nd Floor,OU=Workstations,DC=Domain,DC=co,DC=uk")
Set objMoveComputer = objNewOU.MoveHere ("LDAP://CN=PC00001,CN=Computers,DC=Domain,DC=co,DC=uk", vbNullString)
Is there away that I could run the script locally on pc and use the %computername% variable?
Many thanks
James
I am new to scripting and would like be able to move computer objects within AD based on there IP address?
Example:
192.168.1.1 -> 1st Floor OU
192.168.2.1 -> 2nd Floor OU
Etc...
I have already got a moving script which works great, but this needs me to manually enter the computer name?
Set objNewOU = GetObject("LDAP://OU=2nd Floor,OU=Workstations,DC=Domain,DC=co,DC=uk")
Set objMoveComputer = objNewOU.MoveHere ("LDAP://CN=PC00001,CN=Computers,DC=Domain,DC=co,DC=uk", vbNullString)
Is there away that I could run the script locally on pc and use the %computername% variable?
Many thanks
James