Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: I am Stuck!

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,43680
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: I am Stuck!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: I am Stuck! - 3/6/2007 8:04:40 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
What if I name the sites MRSOH0 and MRSSJ0, MRSAZ0, etc?

(in reply to twilliamsen)
 
 
Post #: 21
 
 RE: I am Stuck! - 3/6/2007 2:49:40 PM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
You might be able to do something like this:


      

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 22
 
 RE: I am Stuck! - 3/6/2007 10:46:26 PM   
  ehvbs

 

Posts: 2061
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Or like this:


      

(just to be slightly different)

(in reply to dm_4ever)
 
 
Post #: 23
 
 RE: I am Stuck! - 3/7/2007 2:39:20 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Ok, the naming part works, but the script does not like connecting to Active Directory, stating the Table does not Exist, Line 51

Which is this:


objCommand.CommandText = "LDAP://dc=corp-nj, dc=mrsassociates, dc=com;(&(cn=" & strLocation & "*)(objectClass=Computer));cn;subtree"

Should it be this?


objCommand.CommandText = "<LDAP://dc=corp-nj, dc=mrsassociates, dc=com>;(&(cn=Computers)(objectClass=Computer));cn;subtree"



(in reply to ehvbs)
 
 
Post #: 24
 
 RE: I am Stuck! - 3/7/2007 2:42:18 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Well, that didn't work either...

Here is an example of a canonical name(cn) of a computer

Corp-NJ.mrsassociates.com/Computers/MRSOH0018

(in reply to twilliamsen)
 
 
Post #: 25
 
 RE: I am Stuck! - 3/7/2007 2:43:25 AM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
You said the test I suggested worked which means this line is wrong somehow: dc=corp-nj, dc=mrsassociates, dc=com
Change it so it looks more like the test example.


_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 26
 
 RE: I am Stuck! - 3/7/2007 2:45:58 AM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
Try this:


      

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 27
 
 RE: I am Stuck! - 3/7/2007 2:55:48 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
I am trying this on a batch of computers we got in recently, since this is what is going to be used for. 

I can run this script on my computer, but not the new computers.  Why is that?  I cannot contact the domain?

I get the following error

The specified domain either does not exist or could not be contacted. 

(in reply to dm_4ever)
 
 
Post #: 28
 
 RE: I am Stuck! - 3/7/2007 3:17:36 AM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
You might have to hard code the domain piece since it isn't on the domain...may even provide alternate credentials.  Just ensure this is correct: dc=corp-nj, dc=mrsassociates, dc=com . You can always echo it out on your machine to verify it. 

Set objRoot = GetObject("LDAP://rootDSE")
strDomain = objRoot.Get("defaultNamingContext")
WScript.Echo strDomain

Alternate credential:
objConnection.Properties("User ID") = "Administrator"
objConnection.Properties("Password") = "+77m5trgJo!"
objConnection.Properties("Encrypt Password") = TRUE
objConnection.Properties("ADSI Flag") = 1

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 29
 
 RE: I am Stuck! - 3/7/2007 3:19:59 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
I moved some of the script blocks around .  Now it joins the domain, but not able to change the name.  Would I need to force it to reboot and start the script again?

(in reply to twilliamsen)
 
 
Post #: 30
 
 RE: I am Stuck! - 3/7/2007 3:25:50 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
I can't echo it.  Got the same error of the specified domain either does not exist or could not be contacted. 


It is joined to the domain, but has not been rebooted yet, that could be the catch

(in reply to dm_4ever)
 
 
Post #: 31
 
 RE: I am Stuck! - 3/7/2007 5:35:43 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
What if split the script into two scripts.

Script 1 does:

1. disabled firewall
2. removes IPv6
3. Joins the domain

Reboots and runs a new script that does

4. renames the computer based on the last computer name in AD
5. finishes other software installations



(in reply to twilliamsen)
 
 
Post #: 32
 
 RE: I am Stuck! - 3/7/2007 11:57:48 PM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Did some research, and found the runonce.exe command.

I will try splitting the script into 2 scripts, then at the end of script 1, will have it execute the runonce for script #2, will that work?

(in reply to twilliamsen)
 
 
Post #: 33
 
 RE: I am Stuck! - 3/8/2007 12:46:47 AM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
I think this may work, but you won't know until you try. Good luck!

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to twilliamsen)
 
 
Post #: 34
 
 RE: I am Stuck! - 3/8/2007 12:58:46 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
I will try it and see how it flies.  Since some of the code cannot execute till the computer is offically on the domain.

(in reply to dm_4ever)
 
 
Post #: 35
 
 RE: I am Stuck! - 3/9/2007 12:53:21 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
runonce is not cooperating with me, neither is the joining the domain nor the name changing.

(in reply to twilliamsen)
 
 
Post #: 36
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: I am Stuck! Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts