title: How to check is a user is in a Domain group?
body: <p>I want to check group membership of a user.  Group are taken from an ldap and inserted into a domain.  For the moment I tried something like this...</p>
  
  <pre><code>#Powershell.ps1
  $CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent()
  $wp = New-Object System.Security.Principal.WindowsPrincipal($CurrentUser)
  # I have in my domain a group called 'dom_group'
  if ( $wp.IsInRole('dom_group') ) {
       "Expected to be true"
  } else {
       "Unexpected False"
  }
  #Unexpected False
  </code></pre>
  
  <p>Unfortunately, this works only for local groups.</p>
  
  <p>How can I check the group membership of the current use against the domain group 'dom_group'?</p>