Solved

script to migrate novell groups to ad groups

Posted on 2011-03-07
2
532 Views
Last Modified: 2012-05-11
Can anybody provide a way of getting netware 6.5 groups out of netware and creating the same named groups in AD? powershell? VBS? Perl? either would be good.

Neil.
0
Comment
Question by:Neil Russell
2 Comments
 
LVL 19

Accepted Solution

by:
deroode earned 500 total points
ID: 35056621
There are a coupe of possibilities:

You can use Microsoft services for Netware to sync eDirectory groups to Active Directory groups, but it is mainly targetted at Server 2003:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=a819838d-acb2-4794-87eb-82a6a3af4be8

What i did on our Server 2008 domain is the following:

- Create a list of groups using the Nlist utility (it's on your Netware server in the SYS:Public directory)

NLIST group show member /r /s /c > C:\temp\groups.txt

It will give you a file in the form:

NAME: ap-group-acrobat
    Member: johnb
    Member: malolmx
    Member: sarahw
NAME: ap-group-ie7
    Member: joshp
    Member: malolmx
    Member: sarahw


- Then created a script with Autoitscript (http://www.autoitscript.com/site/)
- This script creates groups in OU=GROUPTEST,DC=EUR,DC=LOCAL Change as appropriate

Basically what it does is read the Nlist output, for every group after Name: create a group with that name:
'DSADD GROUP "CN='& $group & ',OU=GROUPTEST,DC=EUR,DC=LOCAL

then add the members to that group
DSquery user domainroot -name '& $line & ' | dsmod group "CN=' & $group & ',OU=GROUPTEST,DC=EUR,DC=LOCAL" -addmbr'

I guess it's quite easy to rewrite that in any other language...or even do it in Excel...

 

 
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=C:\temp\ict.ico
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
$groupfilename = FileOpenDialog("select groups file", "C:\temp\", "any (*.txt)", 1)
$groupfile = FileOpen($groupfilename, 0)

Dim $group, $member

; Check if file opened for reading OK
If $groupfile = -1 Then
    MsgBox(0, "Error", "Unable to open groupfile.")
    Exit
EndIf

$fileout = FileOpen (EnvGet("TEMP")&"\adgroups.cmd" ,2)

; Check if file opened for writing OK
If $fileout = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
EndIf
			

; Read in lines of text until the EOF is reached
	
do 
	$line = FileReadLine($groupfile)
Until StringLeft ( $line, 5)="Name:"
MsgBox (0,"",$line)
$group= StringRight ($line,StringLen($line)-6)
MsgBox (0,"",$group)
Do
	FileWriteLine ($fileout, 'DSADD GROUP "CN='& $group & ',OU=GROUPTEST,DC=EUR,DC=LOCAL"')
	Do
		$line = FileReadLine($groupfile)
				;MsgBox(0,"readline",$line)
		$eof = @error
		if $eof <> -1 Then
			if StringInStr($line, "Member:") > 0 Then
				; remove "member"
				;MsgBox(0,"whole line",$line)
				$line=StringRight($line,Stringlen($line)-StringInStr($line,":")-1)
				;MsgBox(0,"without member",$line)
				; get username without trailing dots
				
				$firstdot=StringInStr($line,".")-1
				;MsgBox (0,"firstdot",$firstdot)
				if $firstdot=-1 then 
					$firstdot=Stringlen($line)
				EndIf
				;MsgBox(0,"whole line",$line)
				$line=StringLeft($line,$firstdot)
				;MsgBox(0,"removed dots",$line)
				FileWriteLine ($fileout, 'DSquery user domainroot -name '& $line & ' | dsmod group "CN=' & $group & ',OU=GROUPTEST,DC=EUR,DC=LOCAL" -addmbr')
			Else
				if StringLeft ( $line, 5)="Name:" Then
					$group= StringRight ($line,StringLen($line)-6)
				Else
					do 
						$line = FileReadLine($groupfile)
						$eof = @error
					Until StringLeft ( $line, 5)="Name:" or $eof = -1
					if StringLeft ( $line, 5)="Name:" Then
						$group= StringRight ($line,StringLen($line)-6)
					EndIf
				
				EndIf
				FileWriteLine ($fileout, 'DSADD GROUP "CN='& $group & ',OU=GROUPTEST,DC=EUR,DC=LOCAL"')
			EndIf
		EndIf
	until $eof = -1
until $eof = -1



FileClose($groupfile)

FileClose($fileout)

Run("Notepad.exe " & EnvGet("TEMP")&"\adgroups.cmd")

Open in new window

0
 
LVL 37

Author Closing Comment

by:Neil Russell
ID: 35057760
Excellant! Looks like just the job. Thanks for that. And a new tool I hadnt come across.
0

Join & Write a Comment

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now