Cool Solutions

Importing Computers to Multiple Containers

coolguys

By:

February 24, 2006 12:00 am

Reads: 4438

Comments:0

Score:0

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.

Solution

  1. Create OU
    In the properties of the OU under the Associated Policy Packages:
    	Users Container Package
    	Service Location Package
    	Users Workstation Package
    NDS Rights:
    	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.

  2. Copy text below and paste into notepad, rename to .vbs and save.
  3. 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)
  4. When the computers are reimaged later they maintain the container because of the Image Safe data on the hard drive.

Script

' 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.
'

Option Explicit


Dim CurrentMachine

Dim WshShell

Dim FullPath

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"

WshShell.Run("ZWSREG -unreg")

Wscript.Sleep 5000

WshShell.Run(FullPath)

'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.
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)

Categories: Uncategorized

Disclaimer: This content is not supported by Novell. 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 it thoroughly before using it in a production environment.

Comment

RSS