Ask Your Question
1

how to use xADDomain ?

asked 2015-12-12 09:36:46 -0500

AbNadi gravatar image

I'm trying to install activedirectory with Puppet version 3.8+ and the new DSC module. Currently i'm stuck with the dsc_domainadministratorcrendential part. https://forge.puppetlabs.com/puppetla...

it seems i need to use PSCredential, but no matter how i use it, it doesn not seem to work and i keep getting the error: "Convert property value from type string to type instance failed"

##EXAMPLE AD
class ad_domaintest(
    $DomainAdministratorCredential = "PSCredential",
    $NTDSFolder     = 'C:\NTDS',
    $SYSVOLFolder   = 'C:\SYSVOL'
)
{
# Install the AD role
    dsc_windowsfeature {'ADDSInstall':
    dsc_ensure => 'present',
    dsc_name   => 'AD-Domain-Services',
  }
#Install the AD Tools
    dsc_windowsfeature {'ADDSTools':
    dsc_ensure => 'present',
    dsc_name   => 'RSAT-ADDS',
  }
#ADD NTDS folder  
    dsc_file { 'NTDS Folder':
    dsc_ensure         => 'present',
    dsc_type           => 'Directory',
    dsc_destinationpath => $NTDSFolder,
  }
#ADD SYSVOL folder  
    dsc_file { 'SYSVOL Folder':
    dsc_ensure         => 'present',
    dsc_type           => 'Directory',
    dsc_destinationpath => $SYSVOLFolder,
  }
#Config AD Domain 
    dsc_xaddomain {'FirstDS':
    ensure                              => present,
    dsc_domainname                      => 'domaintest.local',
    dsc_domainadministratorcredential   => $DomainAdministratorCredential,
    dsc_safemodeadministratorpassword   => $DomainAdministratorCredential,
    dsc_databasepath                    => $NTDSFolder,
    dsc_logpath                         => $NTDSFolder,
    dsc_sysvolpath                      => $NTDSFolder,
    }
}
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2016-02-03 08:30:05 -0500

The functionality to use PSCredentials was added in the supported 1.0.0 release. This was after the unsupported 0.8.0 release which had in it's release notes that embedded instance types like PSCredential were not supported yet.

You can accomplish this with the 1.0.0 release by specifying it as a hash:

dsc_xaddomain {'FirstDS':
ensure                              => present,
dsc_domainname                      => 'domaintest.local',
dsc_domainadministratorcredential => {
'user' => 'jane-doe',
'password' => 'jane-password'
},
dsc_safemodeadministratorpassword   => {
'user' => 'jane-doe',
'password' => 'jane-password'
},
dsc_databasepath                    => $NTDSFolder,
dsc_logpath                         => $NTDSFolder,
dsc_sysvolpath                      => $NTDSFolder,
}

For more information about PSCredentials and Puppet DSC module see here https://forge.puppetlabs.com/puppetla...

edit flag offensive delete link more
0

answered 2015-12-16 04:25:19 -0500

AbNadi gravatar image

Because there is absolutely no one who can help, no documentation besides the solutions from powershell for which we don't need puppet, i decided use https://forge.puppetlabs.com/jriviere.... This one works great.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-12-12 09:36:46 -0500

Seen: 408 times

Last updated: Dec 16 '15