On Error Resume Next
Const ForWriting = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objDictionary = CreateObject("Scripting.Dictionary")
strDomain = InputBox("Please Enter the local DNS Domain ie: blat.local ","Hostname"," ")
strPCsFile = "Service_Tag.txt"
strPath = "C:\scripts\" ' Create this folder
strWorkstationID = "C:\scripts\Service_Tag.txt"
i = 0
'#########
Set objFSO3 = CreateObject("Scripting.FileSystemObject")
If objFSO3.FileExists(strPath & strPCsFile) Then
Set objFolder = objFSO3.GetFile(strPath & strPCsFile)
Else
Set objFSOf = CreateObject("Scripting.FileSystemObject")
If objFSOf.FolderExists(strPath) Then
Set objFolder = objFSOf.GetFolder(strPath)
Else
Set objFolder = objFSO3.CreateFolder(strPath)
End If
Set objFile1 = objFSO3.CreateTextFile(strPath & strPCsFile)
objFile1.Close
End If
'#########
Wscript.Echo "This program will return the Dell Service Tag on remote computer(s)"
strMbox = MsgBox("Would you like info for the entire domain: " & strDOmain & " ?",4,"Hostname")
If strMbox = 6 Then
'Set objPCTXTFile = objFSO.OpenTextFile(strPath & strPCsFile, ForWriting, True)
Set objDomain = GetObject("WinNT://" & strDomain) ' Note LDAP does not work
objDomain.Filter = Array("Computer")
For Each pcObject In objDomain
objDictionary.Add i, pcObject.Name
'Wscript.Echo objDictionary(i)
i = i + 1
Next
For each DomainPC in objDictionary
strComputer = objDictionary.Item(DomainPC)
GetWorkstationID()
Next
Set objFilesystem = Nothing
WScript.echo "Finished Scanning Network check : " & strPath & " If the file is empty you entered an incorrect DNS domain"
Else
strHost = InputBox("Enter the computer you wish to find the Dell Service Tag from","Hostname"," ")
GetWorkstationID2()
End If
Sub GetWorkstationID()
On Error Resume Next
Set objWMIservice = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48)
For each objitem in colitems
strWriteFile = strComputer &" Dell Service Tag: " & objitem.serialnumber
Next
'#############
Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.OpenTextFile(strPath & strPCsFile, ForWriting, True)
objOutputFile.WriteLine(strWriteFile)
objOutputFile.Close
'#############
End Sub
Sub GetWorkstationID2()
On Error Resume Next
Wscript.echo strComputer & ": " & objitem.serialnumber
Set objWMIservice = GetObject("winmgmts:\\" & strHost & "\root\cimv2")
set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48)
For each objitem in colitems
Wscript.echo "Computer: " & strHost & " Dell Service Tag: " & objitem.serialnumber
strWriteFile = "Computer: " & strHost &" Dell Service Tag: " & objitem.serialnumber
Next
'%%%%%%%%%%
Set objFileSystem = CreateObject("Scripting.fileSystemObject")
Set objOutputFile = objFileSystem.OpenTextFile(strPath & strPCsFile, ForWriting, True)
objOutputFile.WriteLine(strWriteFile)
objOutputFile.Close
'%%%%%%%%%%
End Sub
Discussion of tips, tricks, and other useful information about technology. May include topics on software applications, hardware, and operating systems.
Wednesday, February 27, 2013
Query domain computers for Dell & other Service Tags
Create a VBS script and enter the following:
Tuesday, January 15, 2013
Rename a Windows domain connected workstation remotely
From the server/domain controller, run NetDom which will rename the workstation to what you want.
You need to reboot the workstation after running this command.
netdom renamecomputer old_name /newname:new_name /userd:domain_admin_login /passwordd:domain_admin_pwd
Sources: http://support.microsoft.com/kb/298593/en-US and http://technet.microsoft.com/en-us/library/cc788029.aspxAnother way to rename a computer is to use Powershell from a server or domain controller.
Rename-computer -computername “targetcomputer” -newname “newcomputername” -domaincredential domain\domain_admin -force -restart
Source: http://technet.microsoft.com/en-us/library/hh849792.aspx
Links to .Net Frameworks Installers
.Net Framework Installers
- 1.1 Redistributable: http://www.microsoft.com/en-us/download/details.aspx?id=26
- 1.1 SP1 Update: http://www.microsoft.com/en-us/download/details.aspx?id=33
- 2.0 SP2 Redistributable: http://www.microsoft.com/en-us/download/details.aspx?id=1639
- 3.5 SP1 Redistributable: http://www.microsoft.com/en-us/download/details.aspx?id=25150
Tuesday, November 27, 2012
How to perform clean Windows 7 Upgrade
How to perform a clean Windows 7 Upgrade.
1. Purchase Windows 7 Upgrade in the retail package. Your existing computer must have Windows XP or Vista on it.
2. Backup your data to an external harddrive, to a flashdrive, to a dvd, to a NAS, to the cloud, etc.
3. Put Windows 7 Upgrade disc in the computer. Use the 64-bit disc if your computer hardware supports 64-bit.
4. Perform clean install where you format the harddrive. DO NOT CLICK UPGRADE.
5. Follow through the install. When it asks for a license key, DO NOT ENTER THE LICENSE KEY. Click skip.
6. Finish with the install and you should be at the Windows 7 desktop.
7. Go to Computer then your optical drive, D: or whatever it is.
8. Run the Windows 7 Upgrade install. This time select Upgrade.
9. If it asks for a license code, provide the code.
10. Complete the install.
11. Check if your computer is activated by right clicking on Computer and selecting Properties. It should say activated. If not, activate the computer and if necessary enter the key.
12. Your computer has Windows 7 cleanly installed without any junk or old files from the previous OS.
1. Purchase Windows 7 Upgrade in the retail package. Your existing computer must have Windows XP or Vista on it.
2. Backup your data to an external harddrive, to a flashdrive, to a dvd, to a NAS, to the cloud, etc.
3. Put Windows 7 Upgrade disc in the computer. Use the 64-bit disc if your computer hardware supports 64-bit.
4. Perform clean install where you format the harddrive. DO NOT CLICK UPGRADE.
5. Follow through the install. When it asks for a license key, DO NOT ENTER THE LICENSE KEY. Click skip.
6. Finish with the install and you should be at the Windows 7 desktop.
7. Go to Computer then your optical drive, D: or whatever it is.
8. Run the Windows 7 Upgrade install. This time select Upgrade.
9. If it asks for a license code, provide the code.
10. Complete the install.
11. Check if your computer is activated by right clicking on Computer and selecting Properties. It should say activated. If not, activate the computer and if necessary enter the key.
12. Your computer has Windows 7 cleanly installed without any junk or old files from the previous OS.
Sunday, November 25, 2012
Compiling echoping 6.0.2 on CentOS/RHEL 5
Here is the commandline options I used to compile echoping 6.0.2 from source:
./configure --with-ssl=/usr/lib/openssl --without-libidn
Tuesday, November 20, 2012
Asterisk installation notes
Here are some generic installation notes for building and installing Asterisk in gnu/Linux. Should work for any distribution. I've tested them with CentOS 5.X.
Install missing development packages, then perform the following inside asterisk source directory:
To add asterisk messages to the daily e-mail report via logwatch:
Install missing development packages, then perform the following inside asterisk source directory:
contrib/scripts/install_prereq install
./configure
use ./configure --prefix=/usr/local/asterisk-1.x.xx.x to install to your own locationmake menuselect
If running asterisk on a VPS, you may need to edit the safe_asterisk file and comment out the line where it says TTY=9 in order to get asterisk to run via initscripts.de-select unnecessary addons and features.make
run contrib/scripts/get_mp3_source.sh to add mp3 support (install subversion first)make config
make install-logrotate
make install
To add asterisk messages to the daily e-mail report via logwatch:
http://www.mcbsys.com/techblog/2012/02/monitor-asterisk-with-logwatch/
Installing ConfigServer Firewall (CSF)
http://configserver.com/cp/csf.html
If you get the following error during installation:
If you get the following error during installation:
Checking Perl modules...Then you need to install perl-libwww-perl package (as well as its prerequisites).
Can't locate LWP/UserAgent.pm in @INC (@INC contains: /etc/csf /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 19) line 2.
BEGIN failed--compilation aborted at (eval 19) line 2.
yum install perl-Compress-Zlib perl-HTML-Tagset perl-URI perl-HTML-Parser perl-libwww-perl
Subscribe to:
Posts (Atom)