1

puppetのドキュメントに従って可能なローカル管理者グループにWindowsドメインユーザーアカウントを設定しようとしています。

user { 'DOMAIN\user':
    groups => ['Administrators'],
}

SIDを使用してみましたが結果はありませんでした。最新のPuppet2.7.19を使用しています

err: /Stage[main]/Teamcity_base/User[S-1-5-21-1759977473-2015113658-625696398-26
038]/ensure: change from absent to present failed: User update failed: SetInfo
    OLE error code:8007089A in Active Directory
      The specified username is invalid.

    HRESULT error code:0x80020009
      Exception occurred.
4

1 に答える 1

2

私の現在の回避策は、「net localgroup」コマンドでバッチ ファイルを実行するカスタム モジュールです。

net localgroup administrators domain\user /add

私の init.pp は、サブスクライブを使用して、バッチ ファイルへの変更を検出します。

class admin {
  $exe_name = "add_admin_users.bat"
  $location = "puppet:///modules/${module_name}/${exe_name}"
  $on_disk = 'C:\add_admin_users.bat'

  file { $on_disk:
    ensure => file,
    source => $location,
    mode   => '750',
  }

  exec { $on_disk:
    subscribe => File[$on_disk],
    refreshonly => true
  }

}

追加しようとする前にユーザーの存在をチェックせずに閉じるため、理想的ではありません。

于 2013-06-18T17:31:25.410 に答える