問題タブ [ou]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
powershell - Ansible で Powershell を使用して OU を取得しようとすると、Active Directory OU が表示されない
単純な Powershell コマンドを使用して、Windows マシンから OU を取得しようとしています。
Powershell on the Machine の管理者として、次の 2 つの方法で試しました。
([adsisearcher]'(&(name=$env:computername)(objectClass=computer))').findall().path
gpresult /r /scope computer
どちらの方法でも、マシン自体で実行すると、問題なく OU が返されます。
しかし、Ansible を使用してこの Powershell コマンドを実行したいと考えています。Ansible で試してみると、両方のコマンドが空の値を返します。Ansible で Powershell コマンドを実行する際に管理者ユーザーを使用しています。
Ansible で Powershell を使用して OU を取得できるようにするには、どうすればよいですか?
これは私の可能なタスクです:
その結果、使用時に
gpresult/r /scope コンピューター
私はこのようなものを得る:
}
使用しようとすると:
([adsisearcher]'(&(name=$env:computername)(objectClass=computer))').findall().path
次のエラー メッセージが表示されます。