Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Delete/retire a computer via VBS

Created: 12 Nov 2012 | 4 comments

Hello, 

Is there a VBS script out there to automatically delete or retire a computer from Altiris 7.1.  Long term thinking would be the ability to massively delete multiple computers at a time.   This would be used for computers that were set to be recycled.     

I have purging maintenance set up, what I looking for is a "on demand" solution.   

 

 

Comments 4 CommentsJump to latest comment

TORB's picture

Hi.

I created this script to delete computers from a txt file (one computer pr line). Modify as needed.

' Migration - remove computers from old Altiris, when using new solution
' Written october 2012 by Torbjørn Remmen Syscom
On Error Resume Next
' Database connection
set db_new = createObject("adodb.connection")
db_new.open "provider=sqloledb;data source=databaseserver;initial catalog=symantec_cmdb;user id=SQLUser;password=SQLpasswod"

' Loop Windows XP

Set objFileToRead = CreateObject("Scripting.FileSystemObject").OpenTextFile("C:\temp\windowxp.txt",1)
Dim strLine

do while not objFileToRead.AtEndOfStream
     strLine = objFileToRead.ReadLine()
    
     sql = "select guid from vCMDBComputer where name like '"  & strLine & "' "

    set rs_new = db_new.execute(sql)

  db_new.execute("insert into itemtodelete(guid) values('" & rs_new(0) & "') ")

 
loop
msgbox "Done"

luke.s's picture

Hi,

http://www.symantec.com/docs/TECH11607

 
Regards

If the suggestion has helped to solve your problem, please mark the post as a solution.

Fábio Sanches
IT Technical Manager | WTR Services | www.wtrservices.com.br

Jeremy V's picture

Anyone have a retire computers from file script...

 

NS 7.1.8280