RE: [ActiveDir] Cookbook sample scripts
Did you change the strDomain value to match your environment? mc -Original Message- From: James Payne [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 11, 2004 1:41 PM To: [EMAIL PROTECTED] Subject: [ActiveDir] Cookbook sample scripts I just bought the Active Directory Cookbook and started looking at some of the sample scripts posted on the author's website. When I attempt to use this one it tells me the server is not operational, line 14 character 1. Can anyone take a look at this and let me know if you see something I have done wrong? Thanks a bunch. ' This VBScript code prints the FSMO role owners for the specified domain. ' --- ' From the book Active Directory Cookbook by Robbie Allen ' Publisher: O'Reilly and Associates ' ISBN: 0-596-00466-4 ' Book web site: http://rallenhome.com/books/adcookbook/code.html ' --- ' -- SCRIPT CONFIGURATION -- strDomain = mydomain.com ' e.g. emea.rallencorp.com ' -- END CONFIGURATION - set objRootDSE = GetObject(LDAP://; strDomain /RootDSE) strDomainDN = objRootDSE.Get(defaultNamingContext) strSchemaDN = objRootDSE.Get(schemaNamingContext) strConfigDN = objRootDSE.Get(configurationNamingContext) ' PDC Emulator set objPDCFsmo = GetObject(LDAP://; strDomainDN) Wscript.Echo PDC Emulator: objPDCFsmo.fsmoroleowner ' RID Master set objRIDFsmo = GetObject(LDAP://cn=RID Manager$,cn=system, strDomainDN) Wscript.Echo RID Master: objRIDFsmo.fsmoroleowner ' Schema Master set objSchemaFsmo = GetObject(LDAP://; strSchemaDN) Wscript.Echo Schema Master: objSchemaFsmo.fsmoroleowner ' Infrastructure Master set objInfraFsmo = GetObject(LDAP://cn=Infrastructure,; strDomainDN) Wscript.Echo Infrastructure Master: objInfraFsmo.fsmoroleowner ' Domain Naming Master set objDNFsmo = GetObject(LDAP://cn=Partitions,; strConfigDN) Wscript.Echo Domain Naming Master: objDNFsmo.fsmoroleowner List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
RE: [ActiveDir] Cookbook sample scripts
?? Did you modify it? Strdomain looks the same as the default. Al -Original Message- From: James Payne [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 11, 2004 1:41 PM To: [EMAIL PROTECTED] Subject: [ActiveDir] Cookbook sample scripts I just bought the Active Directory Cookbook and started looking at some of the sample scripts posted on the author's website. When I attempt to use this one it tells me the server is not operational, line 14 character 1. Can anyone take a look at this and let me know if you see something I have done wrong? Thanks a bunch. ' This VBScript code prints the FSMO role owners for the specified domain. ' --- ' From the book Active Directory Cookbook by Robbie Allen ' Publisher: O'Reilly and Associates ' ISBN: 0-596-00466-4 ' Book web site: http://rallenhome.com/books/adcookbook/code.html ' --- ' -- SCRIPT CONFIGURATION -- strDomain = mydomain.com ' e.g. emea.rallencorp.com ' -- END CONFIGURATION - set objRootDSE = GetObject(LDAP://; strDomain /RootDSE) strDomainDN = objRootDSE.Get(defaultNamingContext) strSchemaDN = objRootDSE.Get(schemaNamingContext) strConfigDN = objRootDSE.Get(configurationNamingContext) ' PDC Emulator set objPDCFsmo = GetObject(LDAP://; strDomainDN) Wscript.Echo PDC Emulator: objPDCFsmo.fsmoroleowner ' RID Master set objRIDFsmo = GetObject(LDAP://cn=RID Manager$,cn=system, strDomainDN) Wscript.Echo RID Master: objRIDFsmo.fsmoroleowner ' Schema Master set objSchemaFsmo = GetObject(LDAP://; strSchemaDN) Wscript.Echo Schema Master: objSchemaFsmo.fsmoroleowner ' Infrastructure Master set objInfraFsmo = GetObject(LDAP://cn=Infrastructure,; strDomainDN) Wscript.Echo Infrastructure Master: objInfraFsmo.fsmoroleowner ' Domain Naming Master set objDNFsmo = GetObject(LDAP://cn=Partitions,; strConfigDN) Wscript.Echo Domain Naming Master: objDNFsmo.fsmoroleowner List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
RE: [ActiveDir] Cookbook sample scripts
strDomain = mydomain.com ' e.g. emea.rallencorp.com needs to be mydomain.com (minus the ) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Payne Sent: Tuesday, May 11, 2004 1:41 PM To: [EMAIL PROTECTED] Subject: [ActiveDir] Cookbook sample scripts I just bought the Active Directory Cookbook and started looking at some of the sample scripts posted on the author's website. When I attempt to use this one it tells me the server is not operational, line 14 character 1. Can anyone take a look at this and let me know if you see something I have done wrong? Thanks a bunch. ' This VBScript code prints the FSMO role owners for the specified domain. ' --- ' From the book Active Directory Cookbook by Robbie Allen ' Publisher: O'Reilly and Associates ' ISBN: 0-596-00466-4 ' Book web site: http://rallenhome.com/books/adcookbook/code.html ' --- ' -- SCRIPT CONFIGURATION -- strDomain = mydomain.com ' e.g. emea.rallencorp.com ' -- END CONFIGURATION - set objRootDSE = GetObject(LDAP://; strDomain /RootDSE) strDomainDN = objRootDSE.Get(defaultNamingContext) strSchemaDN = objRootDSE.Get(schemaNamingContext) strConfigDN = objRootDSE.Get(configurationNamingContext) ' PDC Emulator set objPDCFsmo = GetObject(LDAP://; strDomainDN) Wscript.Echo PDC Emulator: objPDCFsmo.fsmoroleowner ' RID Master set objRIDFsmo = GetObject(LDAP://cn=RID Manager$,cn=system, strDomainDN) Wscript.Echo RID Master: objRIDFsmo.fsmoroleowner ' Schema Master set objSchemaFsmo = GetObject(LDAP://; strSchemaDN) Wscript.Echo Schema Master: objSchemaFsmo.fsmoroleowner ' Infrastructure Master set objInfraFsmo = GetObject(LDAP://cn=Infrastructure,; strDomainDN) Wscript.Echo Infrastructure Master: objInfraFsmo.fsmoroleowner ' Domain Naming Master set objDNFsmo = GetObject(LDAP://cn=Partitions,; strConfigDN) Wscript.Echo Domain Naming Master: objDNFsmo.fsmoroleowner List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
RE: [ActiveDir] Cookbook sample scripts
You can try the slightly modified one I use - it writes the roles out to a text file versus displaying them on the screen ' This VBScript code prints the FSMO role owners for the specified domain. ' --- ' From the book Active Directory Cookbook by Robbie Allen ' Publisher: O'Reilly and Associates ' ISBN: 0-596-00466-4 ' Book web site: http://rallenhome.com/books/adcookbook/code.html ' --- ' MODIFIED by Lou Vega - added output to file versus screen ' -- SCRIPT CONFIGURATION -- strDomain = mydomain.com ' e.g. emea.rallencorp.com OutfileName = AD FSMO Roles - Replace(date,/,) .txt ' -- File Constants -- Const ForReading = 1 Const ForWriting = 2 Const ForAppending = 8 ' -- Open the extract file -- Set Filesys = CreateObject(Scripting.FileSystemObject) Set Outfile = Filesys.OpenTextFile(OutfileName, ForWriting, True) ' -- END CONFIGURATION - set objRootDSE = GetObject(LDAP://; strDomain /RootDSE) strDomainDN = objRootDSE.Get(defaultNamingContext) strSchemaDN = objRootDSE.Get(schemaNamingContext) strConfigDN = objRootDSE.Get(configurationNamingContext) ' PDC Emulator set objPDCFsmo = GetObject(LDAP://; strDomainDN) outfile.writeline PDC Emulator: objPDCFsmo.fsmoroleowner ' RID Master set objRIDFsmo = GetObject(LDAP://cn=RID Manager$,cn=system, strDomainDN) outfile.writeline RID Master: objRIDFsmo.fsmoroleowner ' Schema Master set objSchemaFsmo = GetObject(LDAP://; strSchemaDN) outfile.writeline Schema Master: objSchemaFsmo.fsmoroleowner ' Infrastructure Master set objInfraFsmo = GetObject(LDAP://cn=Infrastructure,; strDomainDN) outfile.writeline Infrastructure Master: objInfraFsmo.fsmoroleowner ' Domain Naming Master set objDNFsmo = GetObject(LDAP://cn=Partitions,; strConfigDN) outfile.writeline Domain Naming Master: objDNFsmo.fsmoroleowner msgbox(All done Chief! vbcrlf Errors: err.number) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of James Payne Sent: Tuesday, May 11, 2004 1:41 PM To: [EMAIL PROTECTED] Subject: [ActiveDir] Cookbook sample scripts I just bought the Active Directory Cookbook and started looking at some of the sample scripts posted on the author's website. When I attempt to use this one it tells me the server is not operational, line 14 character 1. Can anyone take a look at this and let me know if you see something I have done wrong? Thanks a bunch. ' This VBScript code prints the FSMO role owners for the specified domain. ' --- ' From the book Active Directory Cookbook by Robbie Allen ' Publisher: O'Reilly and Associates ' ISBN: 0-596-00466-4 ' Book web site: http://rallenhome.com/books/adcookbook/code.html ' --- ' -- SCRIPT CONFIGURATION -- strDomain = mydomain.com ' e.g. emea.rallencorp.com ' -- END CONFIGURATION - set objRootDSE = GetObject(LDAP://; strDomain /RootDSE) strDomainDN = objRootDSE.Get(defaultNamingContext) strSchemaDN = objRootDSE.Get(schemaNamingContext) strConfigDN = objRootDSE.Get(configurationNamingContext) ' PDC Emulator set objPDCFsmo = GetObject(LDAP://; strDomainDN) Wscript.Echo PDC Emulator: objPDCFsmo.fsmoroleowner ' RID Master set objRIDFsmo = GetObject(LDAP://cn=RID Manager$,cn=system, strDomainDN) Wscript.Echo RID Master: objRIDFsmo.fsmoroleowner ' Schema Master set objSchemaFsmo = GetObject(LDAP://; strSchemaDN) Wscript.Echo Schema Master: objSchemaFsmo.fsmoroleowner ' Infrastructure Master set objInfraFsmo = GetObject(LDAP://cn=Infrastructure,; strDomainDN) Wscript.Echo Infrastructure Master: objInfraFsmo.fsmoroleowner ' Domain Naming Master set objDNFsmo = GetObject(LDAP://cn=Partitions,; strConfigDN) Wscript.Echo Domain Naming Master: objDNFsmo.fsmoroleowner List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
RE: [ActiveDir] Cookbook sample scripts
Unless your domain is named mydomain.com, you need to change line 11 -Original Message- From: James Payne [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 11, 2004 10:41 AM To: [EMAIL PROTECTED] Subject: [ActiveDir] Cookbook sample scripts I just bought the Active Directory Cookbook and started looking at some of the sample scripts posted on the author's website. When I attempt to use this one it tells me the server is not operational, line 14 character 1. Can anyone take a look at this and let me know if you see something I have done wrong? Thanks a bunch. ' This VBScript code prints the FSMO role owners for the specified domain. ' --- ' From the book Active Directory Cookbook by Robbie Allen ' Publisher: O'Reilly and Associates ' ISBN: 0-596-00466-4 ' Book web site: http://rallenhome.com/books/adcookbook/code.html ' --- ' -- SCRIPT CONFIGURATION -- strDomain = mydomain.com ' e.g. emea.rallencorp.com ' -- END CONFIGURATION - set objRootDSE = GetObject(LDAP://; strDomain /RootDSE) strDomainDN = objRootDSE.Get(defaultNamingContext) strSchemaDN = objRootDSE.Get(schemaNamingContext) strConfigDN = objRootDSE.Get(configurationNamingContext) ' PDC Emulator set objPDCFsmo = GetObject(LDAP://; strDomainDN) Wscript.Echo PDC Emulator: objPDCFsmo.fsmoroleowner ' RID Master set objRIDFsmo = GetObject(LDAP://cn=RID Manager$,cn=system, strDomainDN) Wscript.Echo RID Master: objRIDFsmo.fsmoroleowner ' Schema Master set objSchemaFsmo = GetObject(LDAP://; strSchemaDN) Wscript.Echo Schema Master: objSchemaFsmo.fsmoroleowner ' Infrastructure Master set objInfraFsmo = GetObject(LDAP://cn=Infrastructure,; strDomainDN) Wscript.Echo Infrastructure Master: objInfraFsmo.fsmoroleowner ' Domain Naming Master set objDNFsmo = GetObject(LDAP://cn=Partitions,; strConfigDN) Wscript.Echo Domain Naming Master: objDNFsmo.fsmoroleowner List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/ List info : http://www.activedir.org/mail_list.htm List FAQ: http://www.activedir.org/list_faq.htm List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/