[chef] RE: RE: Re: Re: network share in windows


Chronological Thread 
  • From: "Deprez, Tom" < >
  • To: " " < >
  • Subject: [chef] RE: RE: Re: Re: network share in windows
  • Date: Wed, 12 Nov 2014 18:20:39 +0000
  • Accept-language: en-GB, en-US

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:
Sent: 07 November 2014 23:33
To:
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

https://github.com/opscode-cookbooks/dsc

 

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

">

 

From: Kenneth Barry [mailto:
Sent: Friday, November 7, 2014 1:16 PM
To:
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 < " target="_blank"> > 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 <
" target="_blank"> > 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

Image removed by sender.



 

--

Kenneth Barry 

TuneIn | Build and Release Engineer

M: 409-673-0544

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



Archive powered by MHonArc 2.6.16.

§