Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove services remotely?

Status
Not open for further replies.

Scruby

IS-IT--Management
Jul 16, 2003
143
US
Is there a way to remove the Novell Client and IPX/SPX from a workstation remotely?

Thanks, Scruby
 
You can script the removal of the software if you know how to initiate the uninstall from a command line. You would need to document all of the mouse clicks (best if you can use hotkeys like O for OK and N for Next).

I can help you with the script if you need assistance. But you need to provide the above data first.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Thanks Mark,

but I only have a few more computers left to remove the novell client from, however I would like to know if there is a way that I could find out who is logon to the computers on the network (W2K server, workstations XP, W2K, 98, 95)using a script?

Thanks, Scruby
 
I have a smaple script that can do that. Have to hunt around to find it. Will get back to you.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Sorry it to so long to get back to you. Had to write a new script as the one I thought I had did nto do what you are looking for. This one will do it for you. jsut create a text file with a list of workstation names. Call the file WSLIST.TXT. Run this script in the same directory as that file and it will report to you who is logged on each of those workstations. It will create a text file report for you called LogonLocationReport.txt.

'==========================================================================
'
' NAME: ReportLogonLocationsByPC.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: ' DATE : 3/11/2004
'
' COMMENT: <comment>
'
'==========================================================================

On Error Resume Next

'open the file system object
Set oFSO = CreateObject("Scripting.FileSystemObject")

'open the data file
Set oTextStream = oFSO.OpenTextFile("wslist.txt")
'make an array from the data file
RemotePC = Split(oTextStream.ReadAll, vbNewLine)
'close the data file
oTextStream.Close

For Each strComputer In RemotePC
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkConnection",,48)
Report = ""
For Each objItem in colItems
Report = Report & "UserName: " & objItem.UserName & "is logged in at " & strComputer & vbCrLf
Exit For
Next
Next
Set ts = oFSO.CreateTextFile ("LogonLocationReport.txt", ForWriting)
ts.write Report
Set oTextStream = nothing
set ts = nothing
set oFSO = nothing

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Thanks markdmac,

I will try this script, by the way what language is the script wrote in and what would be the best way to learn this language?

Scruby
 
Mark,

Before I start to learn the VBSCript, do you know the variable that will give me the field that is in COMPUTER DESCTIPTION?

Scruby
 
Computer description can be set with ADSI and VBScript.
WMI is not needed. The procedure is exactly the same for
user and computer objects. Technically, the "description"
attribute is multi-valued. The "proper" way is to use the
PutEx method, even though only one value is allowed.
Assuming sufficient rights:

Const ADS_PROPERTY_UPDATE = 2
Set oComputer = GetObject_
("ldap://cn=mycomputer,cn=computers,dc=mydomain,dc=com")
oComputer.PutEx ADS_PROPERTY_UPDATE, _
"description", Array("Admin Computer")

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
You can also find it int he registry:

HKLM\System\CurrentControlSet001\services\lanmanserver\parameters\srvcomment

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
And last one, you can retrieve the info with a simple script:

'==========================================================================
'
' NAME: GetComputerNameDescription.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: ' DATE : 3/12/2004
'
' COMMENT: <comment>
'
'==========================================================================

On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
Report = ""

For Each objItem in colItems
Report = Report & vbCrLf & "Computer Name: " & objItem.CSName
Report = Report & vbCrLf & "Description: " & objItem.Description

Next

WScript.Echo(Report)

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Mark,

Thanks you are the coolest

Scruby
 
Mark,
I have started to learn VB, I have been trying to add to your script (learning) but when I run it I get an error. The error gives me the line number and character number. Do you know of a good free text editor that I can use to troubleshoot the line numbers?

Thanks, scruby
 
You can use anything. Even notepad. <ctrl>+G will give you a rpompt to enter the line number and will move the cursor to it.

I use PrimalScript. You can get a trial version from Sapien.com. Very useful program for scripting.

Post what you have and I can look at it and tell you where you are going wrong.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Mark,

We are deploying TrackIt it’s a help desk tool we are using it for software auditing, One problem it only give us the computer name and all the software that is installed on the computer. It has fields for the user name and computer description but you have to enter them manually or can import them from a txt file. What I would like is to add a few lines to the logon script that will create a text file with the user name, computer name and computer description. Seems like every time some logs in they would overwrite the txt file with there info. Do you know of a way that I could create a txt file using a script that would give me a txt file with the computer name, user name, and computer description?

Thanks Scruby

PS. I have already added some lines to the script that you sent me, this is some cool stuff, For my new job role as a System Administrator I will need to know how to create these kinds of scripts. Thanks again
 
Hi scrubby, sound slike you have a working script to grab the info you want at login. What you want to do to keep it from being overwritten is to open the file FORAPPENDING
rather than FORWRITING.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top