Armando said:
Can someone help me with this problem.
Is there a way that I can find with Perl on what Windows machine a
Domain user account is logged in?
There are two principle ways depending on your setup.
If you are still using Netbios over TCPIP, the old Lanmanager calls will
work and you will be able to use Win32::Lanman.
First get a list of computers with Win32::Lanman::NetServerEnum.
Either loop over all domain controllers and look at the output of
Win32::Lanman::NetSessionEnum or loop over all workstations and get the
logged on users with Win32::Lanman::NetWkstaUserEnum.
For details read the docs that come with the module.
Without the Lanmanager protocol you have to rely on the WMI and ADSI
interfaces that you can use with Win32::OLE (See the Microsoft docs
available on their website. But don't expect an easy solution. The classes
are a real mess, I have never seen something uglier, ... oh wait yes I do:
the Win32 API could win the competition).
Google for examples how to use WMI with perl. There should be at least 3
threads from the last 2 months.
Thomas
--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-