﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Chad Miller / Article Discussions / Article Discussions by Author  / Import/Export SQL Server 2000 Enterprise Manager Registered Servers / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 02:12:27 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>It could be done in VBScript or Perl. Here's an old Perl script. I can't find old VBScript:[code="vb"]#Perl Script based on #http://www.sqlservercentral.com/scripts/contributions/1467.aspuse strict;use Getopt::Std;use Win32::OLE;use Win32::OLE::Const("Microsoft SQLDMO");my (%args, $args, $serverfile, $groupname, $servername, $ServerGroup, $cnt);my $err = 0;my $SQLServer = new Win32::OLE 'SQLDMO.SQLServer';my $Application = $SQLServer-&amp;gt;{Application};getopts('f:', \%args);$serverfile = $args{f};$cnt = 0;open SERVERFILE, $serverfile or die "Cannot open file: $serverfile";while (&amp;lt;SERVERFILE&amp;gt;){	print "Processing $_";	s/#.*//;         # remove comments, ignore blank lines	if (!$_) {next;}	tr/\t /  /s;	$cnt++;	($groupname, $servername) = split;	$ServerGroup = new Win32::OLE 'SQLDMO.ServerGroup';	$ServerGroup = CreateGroup($groupname);	RegisterServer($ServerGroup, $servername);	$ServerGroup = undef;	$servername = undef;}close SERVERFILE;exit $err;sub CreateGroup{	my $ServerGroup = new Win32::OLE 'SQLDMO.ServerGroup';	$ServerGroup-&amp;gt;{Name} = $groupname;	$Application-&amp;gt;ServerGroups-&amp;gt;Add($ServerGroup);	$ServerGroup = undef;	$ServerGroup = $Application-&amp;gt;ServerGroups-&amp;gt;Item($groupname);	return $ServerGroup;}sub RegisterServer{	my $RegisteredServer = new Win32::OLE 'SQLDMO.RegisteredServer';	$RegisteredServer-&amp;gt;{Name} = $servername;	$RegisteredServer-&amp;gt;{UseTrustedConnection} = 1;	$RegisteredServer-&amp;gt;{PersistFlags} = 1;	$ServerGroup-&amp;gt;RegisteredServers-&amp;gt;Add($RegisteredServer);	$RegisteredServer = undef;}[/code]</description><pubDate>Wed, 28 Sep 2011 09:47:34 GMT</pubDate><dc:creator>cmille19</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>Does anyone know if its possible to do this without ps as I'm not allowed to run any ps scripts in my environment.</description><pubDate>Wed, 28 Sep 2011 05:56:08 GMT</pubDate><dc:creator>Andrew LAckenby</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>I noticed the same thing, I'll follow up with the site owners, as it appears be a problem with their script editor. I'm able to reproduce an issue where multiple "?" characters appear when copying the code. It doesn't seem to matter whether I manually create the code with their editor or copy it from notepad. Perhaps it doesn't like some of the special characters (#, %, ?) used in Powershell.</description><pubDate>Fri, 25 Apr 2008 06:48:11 GMT</pubDate><dc:creator>cmille19</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>It seems that the article had some unprintable characters that PS didn't like. I put the code into an editor I have that shows control codes and found them. Removed them and it all works like a charm! :) Thanks</description><pubDate>Fri, 25 Apr 2008 05:55:41 GMT</pubDate><dc:creator>MG-148046</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>Please post the contents of your sqlem.ps1 file</description><pubDate>Thu, 24 Apr 2008 20:07:16 GMT</pubDate><dc:creator>cmille19</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>Doesn't work for me and I set execution to unrestricted. see attachment</description><pubDate>Thu, 24 Apr 2008 12:51:11 GMT</pubDate><dc:creator>MG-148046</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>You once you've sourced the filePS&amp;gt; . ./sqlem.ps1You should be able to simply run the functions the Powershell script defines:Export-RegisteredServers c:\servers.txtorImport-RegisteredServers c:\servers.txt</description><pubDate>Thu, 24 Apr 2008 12:40:49 GMT</pubDate><dc:creator>cmille19</dc:creator></item><item><title>RE: Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>I'm a newbie with PS. I get as far as sourcing the script but have no idea of what to do next.</description><pubDate>Thu, 24 Apr 2008 11:05:44 GMT</pubDate><dc:creator>MG-148046</dc:creator></item><item><title>Import/Export SQL Server 2000 Enterprise Manager Registered Servers</title><link>http://www.sqlservercentral.com/Forums/Topic457263-106-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/powershell/62275/"&gt;Import/Export SQL Server 2000 Enterprise Manager Registered Servers&lt;/A&gt;[/B]</description><pubDate>Tue, 19 Feb 2008 02:30:54 GMT</pubDate><dc:creator>cmille19</dc:creator></item></channel></rss>