##CREATING RW GROUPS
tasks:
- name: Verify we connect for debug
win_shell: hostname
- name: H - Create the RW DL Group
win_domain_group:
state: present
domain_server: "{{ h_domain_server }}"
domain_username: "{{ h_domain_username }}"
domain_password: "{{ h_domain_password }}"
name: "{{ h_dl_prefix }}{{ dl_name }}{{suffix_RW}}"
scope: domainlocal
path: "{{ h_dl_path }}"
# description: "{{ description_rw }}"
fatal: [REDACTED]: FAILED! => {
"changed": false,
"created": false,
"msg": "failed to retrieve initial details for group REDACTED: Parameter: 'Partition' is required for this operation."
PS C:\Users\jal011adm> get-adgroup -identity GDAnsible -server localhost
get-adgroup : Parameter: 'Partition' is required for this operation.
At line:1 char:1
+ get-adgroup -identity GDAnsible -server localhost
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (GDAnsible:ADGroup) [Get-ADGroup], ArgumentException
+ FullyQualifiedErrorId : ActiveDirectoryCmdlet:System.ArgumentException,Microsoft.ActiveDirectory.Management.Commands.GetADGroup
Digging further into it
For AD LDS environments, the Partition parameter must be specified except in the following two conditions:
-The cmdlet is run from an Active Directory provider drive.
-A default naming context or partition is defined for the AD LDS environment. To specify a default naming context for an AD LDS environment, set the msDS-defaultNamingContext property of the Active Directory directory service agent (DSA) object (nTDSDSA) for the AD LDS instance.
Source: https://docs.microsoft.com/en-us/powershell/module/activedirectory/add-adprincipalgroupmembership?view=winserver2012-ps