# migration automation install DT-Agent source # Screening script, providing CMO configuration info &{ $WMIclasses = @( "Win32_ComputerSystem" "Win32_Processor" "Win32_OperatingSystem" "Win32_PhysicalMemory" "Win32_LogicalDisk" "Win32_NetworkAdapterConfiguration" "Win32_PageFile","Win32_TimeZone" "Win32_IP4PersistedRouteTable" ) $CMO = @{} FOREACH ($class in $WMIclasses) { $CMO += @{$class = (Get-WmiObject -Class $class)} IF(-not $?){return} } $ClusterObj = Get-WmiObject -Class "MSCluster_Cluster" -Namespace "root\mscluster" -ErrorAction SilentlyContinue IF($ClusterObj){$Clustering = "FO: $($ClusterObj.Name)"} ELSE{ $ClusterObj = Get-WmiObject -Class "MicrosoftNLB_Cluster" -Namespace "root\MicrosoftNLB" -ErrorAction SilentlyContinue IF($ClusterObj){$Clustering = "NLB: $($ClusterObj.Name)"} ELSE{$Clustering = "N/A"} } $RAMcapacity = $CMO.Win32_PhysicalMemory | Select-Object -ExpandProperty Capacity | %{($_/1MB).ToString()} [hashtable]$RAMtotal = @{} $RAMcapacity | % { IF($RAMtotal.ContainsKey($_)){$RAMtotal.$_++} ELSE{$RAMtotal += @{$_ = 1}} } [array]$Storage = $null $CMO.Win32_LogicalDisk | Where-Object {($_.Size) -and (($_.MediaType -eq 12) -or ($_.MediaType -eq 0))} | % {$Storage += "$($_.DeviceID)<$($_.VolumeName)> - $("{0:N2}" -f (($_.Size - $_.FreeSpace)/1GB)) GB of $("{0:N2}" -f ($_.Size/1GB)) GB used <$($_.FileSystem)>"} [array]$Network = $null $CMO.Win32_NetworkAdapterConfiguration | Where-Object {$_.IpEnabled} | % { [string]$out = "$($_.Description) -> IP=$($_.IPAddress -join ", ")" IF($_.DefaultIPGateway){$out += " | GW=$($_.DefaultIPGateway -join ", ")"} IF($_.DNSServerSearchOrder){$out += " | DNS=$($_.DNSServerSearchOrder -join ", ")"} $Network += $out } IF($CMO.Win32_PageFile){[array]$PageFiles = $CMO.Win32_PageFile | %{"$($_.EightDotThreeFileName) <$($_.FileSize/1MB)/$($_.MaximumSize)MB>"}} $RemoteRegistry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $env:computername) IF(-not $?){return} $dotNETkey = $RemoteRegistry.OpenSubKey("SOFTWARE\Microsoft\NET Framework Setup\NDP") $UACkey = $RemoteRegistry.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system") $outObj = New-Object PSObject -Property @{ Name = $CMO.Win32_ComputerSystem.Name Domain = $CMO.Win32_ComputerSystem.Domain Platform = $CMO.Win32_ComputerSystem.Model OS = "$($CMO.Win32_OperatingSystem.Caption) <$($CMO.Win32_OperatingSystem.OSArchitecture)>" Cluster = $Clustering CPU = (($CMO.Win32_Processor | %{"$(($_.Name).Trim()), $($_.NumberOfCores)-core"}) | Out-String).Trim() RAM = (($RAMtotal.GetEnumerator() | %{"$($_.Value) x $($_.Name)MB"}) | Out-String).Trim() Storage = ($Storage | Out-String).Trim() Network = ($Network | Out-String).Trim() PersRoutes = ($CMO.Win32_IP4PersistedRouteTable | %{"ND=$($_.Name) | GW=$($_.NextHop) | MASK=$($_.Mask) | METRIC=$($_.Metric1)"} | Out-String).Trim() TimeZone = $CMO.Win32_TimeZone.Caption Locale = $CMO.Win32_OperatingSystem.Locale CountryCode = $CMO.Win32_OperatingSystem.CountryCode PageFiles = $PageFiles -join ", " LastBoot = ([Management.ManagementDateTimeConverter]::ToDateTime($CMO.Win32_OperatingSystem.LastBootUpTime)).ToString() dotNET = ($dotNETkey.GetSubKeyNames() | Out-String).Trim() UAC = "$($UACkey.GetValue("EnableLUA")),$($UACkey.GetValue("ConsentPromptBehaviorAdmin"))" } | Select-Object Name,Domain,Platform,OS,Cluster,CPU,RAM,Storage,Network,PersRoutes,TimeZone,Locale,CountryCode,LastBoot,PageFiles,dotNET,UAC Clear-Host $outObj | Out-String | clip Write-Host $outObj Write-Host "`n==> data on clipboard any other key to continue and open noteapad to paste it... <==" -ForegroundColor Yellow }