0
votes
1answer
130 views

Create network shared folder using Powershell on Windows 7

I need to create a shared network folder on windows 7 using PowerShell - I cant get access to New-SmbShare as this is for windows 8 and Windows 2012 Server - any examples would be great. Am I limited ...
8
votes
4answers
584 views

PowerShell DSC copy from network share

I am trying to use PowerShell DSC to copy folder contents from a network share. Here is the code: Configuration TestSetup { Node localhost { File Test { SourcePath = ...
5
votes
1answer
442 views

How can I list hidden administrative shares using PowerShell?

I'm trying to write a script that will audit shared folders on a few HIPAA-sensitive servers. I'm getting a list of shares just fine using gwmi Win32_Share, however when I go to get the permissions on ...
0
votes
2answers
75 views

Copying files from one machine to another

I'm currently generating documentation on one machine, and publishing it to a web server using the following commands in a script: net use "\\someShare" PASSWORD /user:username del /S /Q ...
0
votes
1answer
2k views

Why can't I get the size of network shared folder? by powershell

I've already know a sharespace path: \sharespace\test1 I used this line to get the latest update folder under this path: $lastbuild=get-childitem $var.droppath.TrimEnd()|where-object {$_.name -match ...
0
votes
1answer
845 views

how to use powershell to get childitem of the parent folder and pick up the latest update child folder?

$var.droppath.TrimEnd() # is the parent folder all child folder were named with "10.**"... I can use the following line to get all child folders: get-childitem $var.droppath.TrimEnd()|where-object ...
0
votes
2answers
497 views

Doest Get-PSDrive can map network space?

Here are my codes, $var.droppath is a valid network space path, I've test it. $map3 = new-PSDrive -name droppath -psprovider FileSystem -root $var.droppath Then I ran Get-PSDrive | ?{$_.Name ...
1
vote
1answer
266 views

Failed to check share space via recorded path form sql database by powershell

Could anybody tell me why I failed on these code? 1, I connect to database 2, I query useful information from database (get path) 3, I checked the free space under queried path Here are my codes: ...
0
votes
1answer
302 views

query different free share spaces by powershell, but every time got the same result

Here is my codes: $map = new-Object -com wscript.Network $map.mapNetworkDrive("v:","\\sharespace\testbuilds\test1") $fso = new-Object -com Scripting.FileSystemObject $do = $fso.getdrive("v") ...
0
votes
1answer
495 views

Discover network drives users have manually mapped via remote script

I am trying to write a script that will pull computer names from a text file, then query the remote registrys for any subkeys under hkey_users\SID\network. Then translate the SIDs into the username ...
2
votes
1answer
3k views

How can I use powershell to check if a mapped drive is open / connected?

I am writing a login script which unmaps and remaps some drives. The powershell calls a small batch file for the actual unmapping, as Powershell seems a bit flaky at reliably mapping the drives. The ...
1
vote
2answers
1k views

How can I get the printer shares on a print server using Powershell?

I'm trying to use Powershell to get the print shares from a remote print server. I'm using: Get-WmiObject Win32_Share -computerName "print-server" I'm getting an "access denied" error: ...
4
votes
1answer
2k views

How To Disconnect Users Accessing a Windows Shared Folder using PowerShell

The Determine Users Accessing a Shared Folder Using PowerShell question has a good answer. Continuing on from that How do you disconnect the users accessing the share using a powershell script. ...
2
votes
1answer
2k views

Determine Users Accessing a Shared Folder Using PowerShell

I need to determine the users/sessions accessing a shared folder on a Windows XP (SP2) machine using a PowerShell script (v 1.0). This is the information displayed using Computer Management | System ...
5
votes
4answers
15k views

Creating a Share with Permissions with Windows Powershell

Using Powershell how can I create a share and set access permissions. For example as follows Create share called "public" that maps to the "path c:\shares\foo" Allow DOMAIN1\Users to have ...