Need VBscript for validation

Hi,

Can anyone help me with a validation script (VBscript) with below details.

Requirement : We need the script to validate the 10000+ prod server before and after patching in our environment.

The script should collect below details and the report should save as CSV.

Server name

Domain name

Server up-time

Oracle 12c agent service status

C drive free space

Server is in domain/workgroup

Can any one help me with this please?

Any help is much appreciated.

Regards

Jo



  • Edited by Jonyee 19 hours 21 minutes ago
September 8th, 2015 7:39am

Hi Jonyee, the script needs to be requested in script center

https://gallery.technet.microsoft.com/scriptcenter/site/requests

Sample code - Change it as required or make use of the above link and this is in PowerShell

$servers = Get-Content C:\Temp\Server.txt 
$Coll = @()
foreach($server in $servers)
{
    $Info = Get-WmiObject win32_operatingsystem -ComputerName $server | select csname, @{LABEL='LastBootUpTime';EXPRESSION={(Get-Date) - ($_.ConverttoDateTime($_.lastbootuptime))}}
    $Disk = Get-WmiObject -Class Win32_LogicalDisk -Filter "DeviceID='C:'" -ComputerName $server | Select @{Label='FreeSpace';Expression = {[Math]::Round(($_.FreeSpace / 1GB))}}
    $Group = Get-WmiObject -Class Win32_ComputerSystem -ComputerName $server | Select *
    $service = Get-WmiObject -Class Win32_Service -Filter "Name='Winrm'" -ComputerName $server 
    $Object = New-Object psobject -Property @{
    "Uptimeindays" = $Info.LastBootUpTime.Days
    "ServerName" = $Info.csname
    "FreeSpace(GB)" = $Disk.FreeSpace
    "WorkGroup" = $Group.PartOfDomain
    "WinRMService" = $service.State
    }
    $coll += $Object
    #$Object
    
}
$Coll | Export-Csv C:\Temp\Information.csv -NoTypeInformation

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 8:07am

Hi Chen,

Thanks for the reply.

I have already requested script in above link too.

September 8th, 2015 8:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics