http://qs321.pair.com?node_id=464106

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Perl Version: Activestate 5.6.1, Environment: Windows 2003 running NTEmulation

Problem:

I'm trying to convert some VBScript code to Perl. Specifically, I'm trying to change the home directory path for some users.

Vbscript Code:

Set User = GetObject("WinNT://Domain/" & username & ",user") User.HomeDirectory = "\\server\homeshare" User.SetInfo

Perl Code:

$User=Win32::OLE-> GetObject("WinNT://wsi/$username", "user"); #Reports error - not allowed $User->HomeDirectory="\\server\homeshare" +; #Doesn't Work $update=$User->HomeDirectory("\\server\homeshare"); $set=$update->SetInfo;

How should the vbscript function, User.HomeDirectory = "\\server\homeshare" be written in Perl?

Any help would be much appreciated.