Monthly Archives: November 2016

Server Scan Version 1

As part of current work projects we are being asked to profile servers here is a quick dirty script being used. Has several useful pieces.   $servers = import-csv \\ciwfsxxp0003\andrew\PowershellScripts\ServerMigFunctions\BPO_Policy\servers2.txt -Delimiter “,” $output = “c:\temp\ServerPreScan.txt” foreach ($server in $servers) {

Posted in Powershell, Scripting, Uncategorized, wmi

Registry Reading and ODBC Reading

$standardkeys = @(#array of standard keys you might not wish to read#) $odbckey =”SOFTWARE\\odbc\\odbc.ini” $reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey(‘LocalMachine’,$server.ServerName) $regkey=$reg.OpenSubKey($odbckey) #Retrieve an array of string that contain all the subkey names $subkeys=$regkey.GetSubKeyNames() #Open each Subkey and use GetValue Method to return the required values

Posted in Uncategorized

Things I Might Have Made to Difficult: Or getting a domain name for a host

So in a multi-domain environment you can be given a host-name without the host.  You can also be asked to write a script that might need to work in multiple domains where administrative passwords are not in sync. Hence the

Posted in Uncategorized