Skip to content

Instantly share code, notes, and snippets.

@Iristyle
Last active October 21, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Iristyle/f8563c0261299c68ff32 to your computer and use it in GitHub Desktop.
Save Iristyle/f8563c0261299c68ff32 to your computer and use it in GitHub Desktop.
C:\source\puppet [3.x +19 ~0 -0 !]> git reset --hard origin/3.x
HEAD is now at ed6736d (packaging) Update PUPPETVERSION to 3.8.4
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> $env:path = 'C:\tools\ruby200\bin\;' + $env:path
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> ruby --version
ruby 2.0.0p481 (2014-05-08) [x64-mingw32]
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> del gemfile.lock
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> bundle install --path .bundle/gems
DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/......
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Installing multi_json 1.11.2
Installing i18n 0.6.11
Installing rake 10.1.1
Installing builder 3.0.4
Installing arel 3.0.3
Installing columnize 0.9.0
Installing tzinfo 0.3.45
Installing coderay 1.1.0
Installing diff-lcs 1.2.5
Installing debug_inspector 0.0.2
Installing mime-types 1.25.1
Installing rspec-core 2.14.8
Installing rspec-mocks 2.14.6
Installing ruby-progressbar 1.7.5
Installing ffi 1.9.10
Installing json_pure 1.8.3
Installing metaclass 0.0.4
Installing method_source 0.8.2
Installing minitar 0.5.4
Installing net-ssh 2.9.2
Installing slop 3.6.0
Installing puppet-lint 1.1.0
Installing msgpack 0.6.2
Installing rack 1.6.4
Installing stomp 1.3.4
Using bundler 1.6.3
Installing sqlite3 1.3.11
Installing activesupport 3.2.22
Installing puppet-syntax 2.0.0
Installing rspec-expectations 2.14.5
Installing ruby-prof 0.15.8
Installing rest-client 1.6.7
Installing win32-dir 0.4.9
Installing byebug 5.0.0
Installing binding_of_caller 0.7.2
Installing win32-eventlog 0.6.3
Installing win32-security 0.2.5
Installing win32-service 0.8.7
Installing win32-process 0.7.5
Installing hiera 1.3.4
Installing activemodel 3.2.22
Installing pry 0.10.3
Installing mocha 0.10.5
Installing rspec 2.14.1
Installing couchrest 1.2.0
Installing pry-byebug 3.2.0
Installing activerecord 3.2.22
Installing pry-stack_explorer 0.4.9.2
Installing facter 2.4.4
Installing fuubar 1.3.3
Using puppet 3.8.4 from source at C:/source/puppet
Installing yarjuf 1.0.6
Installing rspec-puppet 2.2.0
Installing puppetlabs_spec_helper 0.10.3
Your bundle is complete!
It was installed into ./.bundle/gems
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> bundle exec puppet resource user
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
user { 'Administrator':
ensure => 'present',
comment => 'Built-in account for administering the computer/domain',
groups => ['Administrators', 'Performance Log Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-500',
}
user { 'Guest':
ensure => 'present',
comment => 'Built-in account for guest access to the computer/domain',
groups => ['Guests'],
uid => 'S-1-5-21-271343509-1886877197-423808128-501',
}
user { 'cyg_server':
ensure => 'present',
groups => ['Administrators', 'Users'],
home => 'C:\cygwin\var\empty',
uid => 'S-1-5-21-271343509-1886877197-423808128-1003',
}
user { 'john':
ensure => 'present',
groups => ['Administrators'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3564',
}
user { 'sshd':
ensure => 'present',
groups => ['Users'],
home => 'C:\cygwin\var\empty',
uid => 'S-1-5-21-271343509-1886877197-423808128-1002',
}
user { 'tim':
ensure => 'present',
groups => ['Administrators', 'Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3643',
}
user { 'vagrant':
ensure => 'present',
comment => 'Vagrant User',
groups => ['TestUsers', 'Administrators', 'Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-1000',
}
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> bundle exec puppet apply .\5271-user-test.pp
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
Notice: Compiled catalog for vagrant-2008r2 in environment production in 0.37 seconds
Notice: /Stage[main]/Main/User[bob_groups]/ensure: created
Notice: /Stage[main]/Main/User[bob]/ensure: created
Error: Failed to logon user "bob_managehome": Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.
Error: /Stage[main]/Main/User[bob_managehome]/ensure: change from absent to present failed: Failed to logon user "bob_managehome": Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.
Notice: /Stage[main]/Main/User[bob_pwd]/ensure: created
Notice: /Stage[main]/Main/User[bob_everything_pwd]/ensure: created
Error: Failed to logon user "bob_everything": Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.
Error: /Stage[main]/Main/User[bob_everything]/ensure: change from absent to present failed: Failed to logon user "bob_everything": Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.
Notice: /Stage[main]/Main/User[bob_managehome_pwd]/ensure: created
Notice: Finished catalog run in 0.45 seconds
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> bundle exec puppet resource user
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
user { 'Administrator':
ensure => 'present',
comment => 'Built-in account for administering the computer/domain',
groups => ['Administrators', 'Performance Log Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-500',
}
user { 'Guest':
ensure => 'present',
comment => 'Built-in account for guest access to the computer/domain',
groups => ['Guests'],
uid => 'S-1-5-21-271343509-1886877197-423808128-501',
}
user { 'bob':
ensure => 'present',
uid => 'S-1-5-21-271343509-1886877197-423808128-3659',
}
user { 'bob_everything':
ensure => 'present',
groups => ['Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3663',
}
user { 'bob_everything_pwd':
ensure => 'present',
groups => ['Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3662',
}
user { 'bob_groups':
ensure => 'present',
groups => ['Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3658',
}
user { 'bob_managehome':
ensure => 'present',
uid => 'S-1-5-21-271343509-1886877197-423808128-3660',
}
user { 'bob_managehome_pwd':
ensure => 'present',
uid => 'S-1-5-21-271343509-1886877197-423808128-3664',
}
user { 'bob_pwd':
ensure => 'present',
uid => 'S-1-5-21-271343509-1886877197-423808128-3661',
}
user { 'cyg_server':
ensure => 'present',
groups => ['Administrators', 'Users'],
home => 'C:\cygwin\var\empty',
uid => 'S-1-5-21-271343509-1886877197-423808128-1003',
}
user { 'john':
ensure => 'present',
groups => ['Administrators'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3564',
}
user { 'sshd':
ensure => 'present',
groups => ['Users'],
home => 'C:\cygwin\var\empty',
uid => 'S-1-5-21-271343509-1886877197-423808128-1002',
}
user { 'tim':
ensure => 'present',
groups => ['Administrators', 'Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3643',
}
user { 'vagrant':
ensure => 'present',
comment => 'Vagrant User',
groups => ['TestUsers', 'Administrators', 'Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-1000',
}
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> dir \users
Directory: C:\users
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/12/2015 4:36 PM Administrator
d----- 10/21/2015 1:10 AM bob_everything_pwd
d----- 10/21/2015 1:10 AM bob_managehome_pwd
d----- 9/19/2014 3:57 PM Classic .NET AppPool
d----- 9/17/2013 11:08 AM cyg_server
d-r--- 7/13/2009 9:57 PM Public
d----- 10/17/2013 10:50 AM vagrant
##### CHANGE MANIFEST TO DELETE
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> bundle exec puppet apply .\5271-user-test.pp
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
Notice: Compiled catalog for vagrant-2008r2 in environment production in 0.41 seconds
Notice: /Stage[main]/Main/User[bob_groups]/ensure: removed
Notice: /Stage[main]/Main/User[bob]/ensure: removed
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 15:C:/source/puppet/5271-user-test.pp
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 15:C:/source/puppet/5271-user-test.pp
Wrapped exception:
(in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred.
Error: /Stage[main]/Main/User[bob_managehome]/ensure: change from present to absent failed: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 15:C:/source/puppet/5271-user-test.pp
Notice: /Stage[main]/Main/User[bob_pwd]/ensure: removed
Notice: /Stage[main]/Main/User[bob_everything_pwd]/ensure: removed
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 35:C:/source/puppet/5271-user-test.pp
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 35:C:/source/puppet/5271-user-test.pp
Wrapped exception:
(in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred.
Error: /Stage[main]/Main/User[bob_everything]/ensure: change from present to absent failed: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 35:C:/source/puppet/5271-user-test.pp
Notice: /Stage[main]/Main/User[bob_managehome_pwd]/ensure: removed
Notice: Finished catalog run in 0.20 seconds
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> dir \users
Directory: C:\users
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/12/2015 4:36 PM Administrator
d----- 9/19/2014 3:57 PM Classic .NET AppPool
d----- 9/17/2013 11:08 AM cyg_server
d-r--- 7/13/2009 9:57 PM Public
d----- 10/17/2013 10:50 AM vagrant
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> bundle exec puppet resource user
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
user { 'Administrator':
ensure => 'present',
comment => 'Built-in account for administering the computer/domain',
groups => ['Administrators', 'Performance Log Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-500',
}
user { 'Guest':
ensure => 'present',
comment => 'Built-in account for guest access to the computer/domain',
groups => ['Guests'],
uid => 'S-1-5-21-271343509-1886877197-423808128-501',
}
user { 'cyg_server':
ensure => 'present',
groups => ['Administrators', 'Users'],
home => 'C:\cygwin\var\empty',
uid => 'S-1-5-21-271343509-1886877197-423808128-1003',
}
user { 'john':
ensure => 'present',
groups => ['Administrators'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3564',
}
user { 'sshd':
ensure => 'present',
groups => ['Users'],
home => 'C:\cygwin\var\empty',
uid => 'S-1-5-21-271343509-1886877197-423808128-1002',
}
user { 'tim':
ensure => 'present',
groups => ['Administrators', 'Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-3643',
}
user { 'vagrant':
ensure => 'present',
comment => 'Vagrant User',
groups => ['TestUsers', 'Administrators', 'Users'],
uid => 'S-1-5-21-271343509-1886877197-423808128-1000',
}
C:\source\puppet [3.x...origin/3.x +20 ~0 -0 !]> git merge --no-ff --log pr/4336
Merge made by the 'recursive' strategy.
lib/puppet/util/windows/adsi.rb | 2 ++
spec/unit/provider/user/windows_adsi_spec.rb | 1 -
spec/unit/util/windows/adsi_spec.rb | 13 +++++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)
C:\source\puppet [3.x +20 ~0 -0 !]> bundle exec puppet apply .\5271-user-test.pp
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
Notice: Compiled catalog for vagrant-2008r2 in environment production in 0.34 seconds
Notice: /Stage[main]/Main/User[bob_groups]/ensure: created
Notice: /Stage[main]/Main/User[bob]/ensure: created
Error: Failed to logon user "bob_managehome": The user's password must be changed before logging on the first time.
Error: /Stage[main]/Main/User[bob_managehome]/ensure: change from absent to present failed: Failed to logon user "bob_managehome": The user's password must be changed before logging on the first time.
Notice: /Stage[main]/Main/User[bob_pwd]/ensure: created
Notice: /Stage[main]/Main/User[bob_everything_pwd]/ensure: created
Error: Failed to logon user "bob_everything": The user's password must be changed before logging on the first time.
Error: /Stage[main]/Main/User[bob_everything]/ensure: change from absent to present failed: Failed to logon user "bob_everything": The user's password must be changed before logging on the first time.
Notice: /Stage[main]/Main/User[bob_managehome_pwd]/ensure: created
Notice: Finished catalog run in 0.39 seconds
C:\source\puppet [3.x +20 ~0 -0 !]> dir \users
Directory: C:\users
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/12/2015 4:36 PM Administrator
d----- 10/21/2015 1:17 AM bob_everything_pwd
d----- 10/21/2015 1:17 AM bob_managehome_pwd
d----- 9/19/2014 3:57 PM Classic .NET AppPool
d----- 9/17/2013 11:08 AM cyg_server
d-r--- 7/13/2009 9:57 PM Public
d----- 10/17/2013 10:50 AM vagrant
##### CHANGE MANIFEST TO DELETE
C:\source\puppet [3.x +20 ~0 -0 !]> bundle exec puppet apply .\5271-user-test.pp
DL is deprecated, please use Fiddle
DL is deprecated, please use Fiddle
Notice: Compiled catalog for vagrant-2008r2 in environment production in 0.34 seconds
Notice: /Stage[main]/Main/User[bob_groups]/ensure: removed
Notice: /Stage[main]/Main/User[bob]/ensure: removed
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 16:C:/source/puppet/5271-user-test.pp
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 16:C:/source/puppet/5271-user-test.pp
Wrapped exception:
(in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred.
Error: /Stage[main]/Main/User[bob_managehome]/ensure: change from present to absent failed: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 16:C:/source/puppet/5271-user-test.pp
Notice: /Stage[main]/Main/User[bob_pwd]/ensure: removed
Notice: /Stage[main]/Main/User[bob_everything_pwd]/ensure: removed
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 37:C:/source/puppet/5271-user-test.pp
Error: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 37:C:/source/puppet/5271-user-test.pp
Wrapped exception:
(in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred.
Error: /Stage[main]/Main/User[bob_everything]/ensure: change from present to absent failed: Could not set 'absent' on ensure: (in OLE method `Delete': )
OLE error code:80070002 in SWbemServicesEx
The system cannot find the file specified.
HRESULT error code:0x80020009
Exception occurred. at 37:C:/source/puppet/5271-user-test.pp
Notice: /Stage[main]/Main/User[bob_managehome_pwd]/ensure: removed
Notice: Finished catalog run in 0.19 seconds
user {'bob':
ensure => present,
}
user {'bob_pwd':
ensure => present,
password => '@#SAFSawasf123',
}
# failure message, but created
# however, no home directory
# error calling absent, but user removed
user {'bob_managehome':
ensure => present,
managehome => true,
}
user {'bob_managehome_pwd':
ensure => present,
managehome => true,
password => '@#SAFSawasf123',
}
user {'bob_groups':
ensure => present,
groups => 'Users',
}
# failure message, but created
# however, no home directory
# error calling absent, but user removed
user {'bob_everything':
ensure => present,
managehome => true,
groups => 'Users',
}
user {'bob_everything_pwd':
ensure => present,
password => '@#SAFSawasf123',
managehome => true,
groups => 'Users',
}
@Iristyle
Copy link
Author

This is based off of a local security policy that looks like this:

screen shot 2015-10-21 at 9 03 43 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment