Skip to content

Instantly share code, notes, and snippets.

@bielawb
Created May 25, 2022 21:47
Show Gist options
  • Save bielawb/bf00a5d3529499d51d5d859bc1505a09 to your computer and use it in GitHub Desktop.
Save bielawb/bf00a5d3529499d51d5d859bc1505a09 to your computer and use it in GitHub Desktop.
PropertiesToLoad - tylko do odczytu, ustawiamy przez konstruktor
$szukajka = [adsisearcher]::new()
$szukajka.PropertiesToLoad = 'samAccountName', 'distinguishedName'
<# Na wyjściu: błąd
'PropertiesToLoad' is a ReadOnly property.
#>
$drugaSzukajka = [adsisearcher]::new(
'(name=bartosz*)', # string filter
('samAccountName', 'distinguishedName') # string[] propertiesToLoad
)
$drugaSzukajka.PropertiesToLoad
<# Na wyjściu: oczekiwana lista właściwości:
samAccountName
distinguishedName
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment