ENVIRONMENT: Windows XP Pro SP2, ZENworks 6.5
PROBLEM: Importing computers to more than one container when they are importing based on Selected Container in Import Policy.
- Create OU
In the properties of the OU under the Associated Policy Packages:
Users Container Package
Service Location Package
Users Workstation Package
Users Server Package: Workstation Import Policy
Users Server Package: Workstation Removal Policy
You have to edit the vbscript based on your Tree and OUs.
The computers will be imported based on computer name from the variable pulled from the registry.
- Copy text below and paste into notepad, rename to .vbs and save.
- After computers import into the OU stated in Import Policy, run this vb script on the computers you want imported into the other OU.
(Create a ZENworks application of run locally the vbscript)
- When the computers are reimaged later they maintain the container because of the Image Safe data on the hard drive.
' This script runs the necessary commands to import computers into
' the designated OU.
' Since the default container on the server import policy is , the
' machine first unregisters itself. A VBS is required as the machine
' name is part of the command required.
Set WshShell = WScript.CreateObject("WScript.Shell")
CurrentMachine = WshShell.RegRead ("HKLM\System\ControlSet001\Control\ComputerName\ComputerName\ComputerName")
FullPath = "ZWSREG -importws cn=" & CurrentMachine & ".ou=workstations2.ou=zenworks.o=tree"
'I put a return in after each line of the script to show the different lines because of wordwrap in the posting area of the website.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.