Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Sharing folder on remote server


Recommended Posts

Posted

I've got an AutoIT script that creates new users and on our old server 2003 server it would also use WMI to share their home folder.

Since we upgraded to 2008 r2 I've tried running the script again and it does everything apart from sharing the folder on the server.

it uses the win32_process command which i've read should still work on 64 bit servers.

 

this is the command, which worked on server 2003 but no longer works, can anyone see why it doesn't?

 

$FILE_SHARE=0

$MAXIMUM_CONNECTIONS=-1

$objWMIService = objGet("winmgmts:\\" & $datacomp & "\root\cimv2:Win32_Process")

$Locator=ObjCreate("WbemScripting.SWbemLocator")

$objWMIService = $Locator.ConnectServer($datacomp, "\root\CIMV2")

$objNewShare = $objWMIService.Get("Win32_Share")

$objNewShare.Create('"' & "F:\Home Directories\Junior Pupils\" & $username & '"', $username & "$", $FILE_SHARE, $MAXIMUM_CONNECTIONS, "Share for " & $username)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...