|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Remote Login from Script
i have 11 Servers.
Server1 to server10 are standalone servers Server0 can connect to all these 10 servers.[more like a domain controller] i want my script to be in Server0 and it has to connect to each server [same uid and pass for all servers] and run the script and put the output in a text file and store it in server0. now i have worked a script which works on a stand alone machine and outputs the file. I need to know how to make the script login-->run the script-->output/save File-->Logout. Do this for all the servers listed in a text file. On Mar 17, 12:00 pm, Miztiik <Mizt***@discussions.microsoft.com>
wrote: Show quote > i have 11 Servers. You can either use psexec.exe or the Create method in WMI's> Server1 to server10 are standalone servers > Server0 can connect to all these 10 servers.[more like a domain controller] > > i want my script to be in Server0 and it has to connect to each server [same > uid and pass for all servers] and run the script and put the output in a text > file and store it in server0. > > now i have worked a script which works on a stand alone machine and outputs > the file. > > I need to know how to make the script > > login-->run the script-->output/save File-->Logout. > > Do this for all the servers listed in a text file. Win32_Process class to remotely execute the script. You could modify the script on the remote server to write the output file directly to server0. can this tool run a process in all the servers simultanaously?
and how to modify the script source to save the files to server 0 "Miztiik" <Mizt***@discussions.microsoft.com> wrote in message what is the output?news:5CA46375-2D61-41B2-967E-4BD2D7F28C6F@microsoft.com... > can this tool run a process in all the servers simultanaously? > and > how to modify the script source to save the files to server 0 most things can be obtained with WMI thuis script gets a list of computers and get the name of the videocard drivers on each machine, then writes then to a text file, this script uses the WMI object Win32_VideoController, there are hundreds more WMI objects that can find out almoslet all you neeed to know on error resume next Dim fso:Set fso = CreateObject("Scripting.FileSystemObject") dim computers:computers = Array("slim","hank","loretta") dim videoCards:set videoCards = fso.CreateTextFile("videoCards.txt",true) dim strComputer,vCards for each strComputer in computers Set oWMI = GetObject("winmgmts:" & _ "{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2") Set vCards = oWMI.ExecQuery("Select * from Win32_VideoController") For Each thing in vCards dString = strComputer & vbTab & thing.Name WScript.Echo dString videoCards.WriteLine dString Next next videoCards.close
Show quote
On Mar 19, 8:23 am, "ThatsIT.net.au" <me@thatsit> wrote: Question:> "Miztiik" <Mizt***@discussions.microsoft.com> wrote in message > > news:5CA46375-2D61-41B2-967E-4BD2D7F28C6F@microsoft.com... > > > can this tool run a process in all the servers simultanaously? > > and > > how to modify the script source to save the files to server 0 > > what is the output? > > most things can be obtained with WMI > > thuis script gets a list of computers and get the name of the videocard > drivers on each machine, then writes then to a text file, this script uses > the WMI object Win32_VideoController, there are hundreds more WMI objects > that can find out almoslet all you neeed to know > > on error resume next > Dim fso:Set fso = CreateObject("Scripting.FileSystemObject") > > dim computers:computers = Array("slim","hank","loretta") > > dim videoCards:set videoCards = fso.CreateTextFile("videoCards.txt",true) > > dim strComputer,vCards > > for each strComputer in computers > Set oWMI = GetObject("winmgmts:" & _ > "{impersonationLevel=Impersonate}!\\" & strComputer & "\root\cimv2") > Set vCards = oWMI.ExecQuery("Select * from Win32_VideoController") > For Each thing in vCards > dString = strComputer & vbTab & thing.Name > WScript.Echo dString > videoCards.WriteLine dString > Next > > next > > videoCards.close > can this tool run a process in all the servers simultanaously? Answer:Yes, you can just use a for loop to call it for each server. but each server requires authentication to get connected to the server and
to run the script so how will i authenticate to the server from within the script?[assuming i have one user uid and pass configured in all comps especially for this purpose] |
|||||||||||||||||||||||