Share via

AD-Fileshare from New-ADObject

Zero Nine 116 Reputation points
2021-11-22T21:40:04.247+00:00

I'm trying to create a way to script out creating file shares in AD rather than having to use mapped drives or GPOs. The issue that I'm having is that the New-ADObject type does not seem to include an option for file share, but if I look at an existing share in AD it just has the objectClass as top; leaf; connectionPoint; volume. If anybody could help me figure this out so I can automate the process that would be great.

Windows for business | Windows Server | User experience | PowerShell
0 comments No comments

Answer accepted by question author

Zero Nine 116 Reputation points
2021-11-23T13:27:23.88+00:00

I was able to find an answer to this here: https://social.msdn.microsoft.com/Forums/en-US/6c5b3fda-650c-4d28-bcf6-884e50b524ae/powershell-newadobject-type-volume?forum=windowsgeneraldevelopmentissues

Basically the syntax is:

New-AdObject -Name 'WhatEverYouWantToCallIt" -type 'Volume' -Path "DistinguishedADPath" -OtherAttributes @{ 'uNCName' = '\servername\sharename\' }

This will eliminate your need for mapped drives by teaching users to go to Network > Search Active Directory > Find: Shared Folders > Find Now

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.