Network share in windows


#1

I can’t find a cookbook/resource for creating network shares. Anyone aware
of one? I hate doing things in script if i can avoid it…

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com


#2

How about using the DSC cookbook and DSC resource xSMBShare to create the shares?

https://gallery.technet.microsoft.com/scriptcenter/xSmbShare-PowerShell-cafb8ba6

Dylan Grafmyre
IT Support
Tech Partners Hawaii
808-877-5557 ext 104
Sent from my iPhone

On Nov 7, 2014, at 12:48 PM, Kenneth Barry <kbarry@tunein.commailto:kbarry@tunein.com> wrote:

I can’t find a cookbook/resource for creating network shares. Anyone aware of one? I hate doing things in script if i can avoid it…

Kenneth Barry

TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.comhttp://www.tunein.com/
[http://d11im0xz45jykv.cloudfront.net/email/logo_signature.png]


#3

I thought that was only with the new chef server?
We are on 11.4

On Fri, Nov 7, 2014 at 2:53 PM, Dylan K. Grafmyre <
dylan@techpartnershawaii.com> wrote:

How about using the DSC cookbook and DSC resource xSMBShare to create
the shares?

https://gallery.technet.microsoft.com/scriptcenter/xSmbShare-PowerShell-cafb8ba6

Dylan Grafmyre
IT Support
Tech Partners Hawaii
808-877-5557 ext 104
Sent from my iPhone

On Nov 7, 2014, at 12:48 PM, Kenneth Barry kbarry@tunein.com wrote:

I can’t find a cookbook/resource for creating network shares. Anyone
aware of one? I hate doing things in script if i can avoid it…

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.com


#4

I think you just need WMF4.0/Powershell 4.0 on your system to use DSC_Resource.

http://docs.getchef.com/resource_dsc_resource.html

I believe Chef Server 12 will have the DSC_Resource baked in without needing the DSC Cookbook, but I could be totally wrong about this?

Aloha,
Dylan Grafmyre
Tech Partners Hawaii
808-877-5557 x 104
dylan@techpartnershawaii.commailto:dylan@techpartnershawaii.com

From: Kenneth Barry [mailto:kbarry@tunein.com]
Sent: Friday, November 7, 2014 1:16 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: network share in windows

I thought that was only with the new chef server?
We are on 11.4

On Fri, Nov 7, 2014 at 2:53 PM, Dylan K. Grafmyre <dylan@techpartnershawaii.commailto:dylan@techpartnershawaii.com> wrote:
How about using the DSC cookbook and DSC resource xSMBShare to create the shares?

https://gallery.technet.microsoft.com/scriptcenter/xSmbShare-PowerShell-cafb8ba6

Dylan Grafmyre
IT Support
Tech Partners Hawaii
808-877-5557 ext 104
Sent from my iPhone

On Nov 7, 2014, at 12:48 PM, Kenneth Barry <kbarry@tunein.commailto:kbarry@tunein.com> wrote:
I can’t find a cookbook/resource for creating network shares. Anyone aware of one? I hate doing things in script if i can avoid it…

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.comhttp://www.tunein.com/
[http://d11im0xz45jykv.cloudfront.net/email/logo_signature.png]

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.comhttp://www.tunein.com/
[http://d11im0xz45jykv.cloudfront.net/email/logo_signature.png]


#5

You don’t have to wait for a Chef 12 release to use DSC – you can use it in
a less seamless form via the dsc_script resource in Chef 11.16.0 and higher:

https://docs.getchef.com/resource_dsc_script.html

You’re right Dylan that our plan is to bake in the functionality from the
cookbook you reference below – it’s more seamless than dsc_script and does
not require you to understand anything about the DSC / PowerShell language
(you can stay strictly within the Chef DSL), you just need to understand
what the DSC resources actually do to the system. Also, it doesn’t depend
on the server, it’s a client feature, so expect to see the more seamless
stuff in a future Chef Client release.

Kenneth, you can also take a look at this PR from viebrock or the windows
cookbook, though I would also like to make this a native part of Chef and
not some cookbook:

Lastly, I happened to use file share creation as an example of a feature we
introduced in Chef 11.12.0 in the release notes:

powershell_script ‘make_logshare’ do

guard_interpreter :powershell_script

code ‘new-smbshare logshare $env:systemdrive\logs’

not_if ‘get-smbshare logshare’

end

-Adam

From: Dylan K. Grafmyre [mailto:dylan@techpartnershawaii.com]
Sent: Friday, November 7, 2014 3:33 PM
To: chef@lists.opscode.com
Subject: [chef] RE: Re: Re: network share in windows

I think you just need WMF4.0/Powershell 4.0 on your system to use
DSC_Resource.

http://docs.getchef.com/resource_dsc_resource.html

I believe Chef Server 12 will have the DSC_Resource baked in without
needing the DSC Cookbook, but I could be totally wrong about this?

Aloha,

Dylan Grafmyre

Tech Partners Hawaii

808-877-5557 x 104

dylan@techpartnershawaii.com

From: Kenneth Barry [mailto:kbarry@tunein.com kbarry@tunein.com]
Sent: Friday, November 7, 2014 1:16 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: network share in windows

I thought that was only with the new chef server?

We are on 11.4

On Fri, Nov 7, 2014 at 2:53 PM, Dylan K. Grafmyre <
dylan@techpartnershawaii.com> wrote:

How about using the DSC cookbook and DSC resource xSMBShare to create the
shares?

https://gallery.technet.microsoft.com/scriptcenter/xSmbShare-PowerShell-cafb8ba6

Dylan Grafmyre

IT Support

Tech Partners Hawaii

808-877-5557 ext 104

Sent from my iPhone

On Nov 7, 2014, at 12:48 PM, Kenneth Barry kbarry@tunein.com wrote:

I can’t find a cookbook/resource for creating network shares. Anyone aware
of one? I hate doing things in script if i can avoid it…

Kenneth Barry

TuneIn | Build and Release Engineer

M: 409-673-0544

www.tunein.com

Kenneth Barry

TuneIn | Build and Release Engineer

M: 409-673-0544

www.tunein.com


#6

Hi,

We used to use a custom powershell script to create a share and add a user to it. This needed revising to handle more than one user but it looks like the dsc cookbook along with the xSMBShare resource can do this more elegantly for us. However, I’m having a few problems getting dsc_resource to allow me to add more than one user to the share.

The 2nd example on here (https://gallery.technet.microsoft.com/scriptcenter/xSmbShare-PowerShell-cafb8ba6) shows that multiple users can be added to a share using an array,
NoAccess = @(“User3”, “User4”)

Is there a way for me to replicate this using the dsc_resource parameters, ie property :ChangeAccess, ?

property :ChangeAccess, [“user1”,”user2”] doesn’t work (I’m guessing the array isn’t converted?)

property :ChangeAccess, “user1”
property :ChangeAccess,”user2”
Will only add the last user

property :ChangeAccess, “@(\”user1\”,\”user2\”)”
Doesn’t want to work either

Creating 2 dsc_resources will only add the user in the last dsc_resource.

Looking through the cookbook, I tried doing something similar to dsc::telnet. However dsc::telnet fails as it cannot find the dsc_configuration_script method.

I’m using chef-client 11.12.0 (and windows 0.30.0), so using dsc_script isn’t an option as of yet. I’m hoping there’s a way I can use the dsc cookbook?

Incidentally, xSMBShare also falls foul of https://github.com/opscode-cookbooks/dsc/issues/8.

Thanks
Tom

From: Dylan K. Grafmyre [mailto:dylan@techpartnershawaii.com]
Sent: 07 November 2014 23:33
To: chef@lists.opscode.com
Subject: [chef] RE: Re: Re: network share in windows

I think you just need WMF4.0/Powershell 4.0 on your system to use DSC_Resource.

http://docs.getchef.com/resource_dsc_resource.html

I believe Chef Server 12 will have the DSC_Resource baked in without needing the DSC Cookbook, but I could be totally wrong about this?

Aloha,
Dylan Grafmyre
Tech Partners Hawaii
808-877-5557 x 104
dylan@techpartnershawaii.commailto:dylan@techpartnershawaii.com

From: Kenneth Barry [mailto:kbarry@tunein.com]
Sent: Friday, November 7, 2014 1:16 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Re: network share in windows

I thought that was only with the new chef server?
We are on 11.4

On Fri, Nov 7, 2014 at 2:53 PM, Dylan K. Grafmyre <dylan@techpartnershawaii.commailto:dylan@techpartnershawaii.com> wrote:
How about using the DSC cookbook and DSC resource xSMBShare to create the shares?

https://gallery.technet.microsoft.com/scriptcenter/xSmbShare-PowerShell-cafb8ba6

Dylan Grafmyre
IT Support
Tech Partners Hawaii
808-877-5557 ext 104
Sent from my iPhone

On Nov 7, 2014, at 12:48 PM, Kenneth Barry <kbarry@tunein.commailto:kbarry@tunein.com> wrote:
I can’t find a cookbook/resource for creating network shares. Anyone aware of one? I hate doing things in script if i can avoid it…

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.comhttp://www.tunein.com/
[Image removed by sender.]

Kenneth Barry
TuneIn | Build and Release Engineer
M: 409-673-0544
www.tunein.comhttp://www.tunein.com/
[Image removed by sender.]

HBVB trading as Bauer Corporate Services (BCS) is a division of the Bauer Media
Group the largest consumer publisher in the UK, and second largest commercial
radio broadcaster. BCS provides financial services and manages and develops IT
systems on which our UK publishing, broadcast, digital and partner businesses depend.

The information in this email is intended only for the addressee(s) named above.
Access to this email by anyone else is unauthorised. If you are not the intended
recipient of this message any disclosure, copying, distribution or any action
taken in reliance on it is prohibited and may be unlawful. HBVB do not warrant that
any attachments are free from viruses or other defects and accept no liability for
any losses resulting from infected email transmissions.

Please note that any views expressed in this email may be those of the originator
and do not necessarily reflect those of this organisation.

HBVB is registered in England; Registered address is
1 Lincoln Court, Lincoln Road, Peterborough, PE1 2RF.

Registration number 8453545