Yes it is slightly offtopic. But you could check if there was a global policy in place. Some companies don't want people touching the registry. You might also remove and add your machine to the domain. I have seen dorked machine accounts do strange things.
Some other considerations:
What if the machine is down. Tie-Registry will give you a can't open the registry error. Which at times could be misleading and make you walk to the machine.
If you make use of Net::Ping you could give yourself a down message.
Anothing. If you have a lousy Windows ME on the network. Well you don't have Remote Registry access so you will have to code around it.
Here is a partial snippet of a domain virus report I wrote.
if ($p->ping($computer)) {
if ($key = $Registry->Open("/$computer/LMachine/SYSTEM/CurrentCont
+rolSet/" .
"Control/ComputerName/ComputerName/", {Access=>KEY_REA
+D}) ) {
unless ($name = $key->GetValue("ComputerName")) {
print "Could not attach to read ComputerName o
+n $computer\n";
printf $fh "Could not attach to read ComputerN
+ame on $computer\n";
}
The ping takes care of machines that are down and the open took care of registry access issues.
|