Closed Bananovics closed 3 years ago
Solved by myself :)
Hi, how did you solve this?
Hi!
I added a condition when import GAL to $contactlist. I used $ContactList = Get-User -ResultSize unlimited | Where {$.SKUAssigned -eq "TRUE" -and $.UserAccountControl -eq "NormalAccount"} instead of $ContactList = Get-User -ResultSize unlimited
You can find these lines in EWSContacts\Module\functions\contacts\Get-GALContacts.ps1 line 53.
Cheers!
Thanks! I replaced the line but get an error
Where : The term '$.SKUAssigned' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:34
+ CategoryInfo : ObjectNotFound: ($.SKUAssigned:String) [Where-Object], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.WhereObjectCommand
Any idea?
You can run only command Get-User -ResultSize unlimited | Where {$.SKUAssigned -eq "TRUE" -and $.UserAccountControl -eq "NormalAccount"} in PS and check the result. If it starts to listing user mailboxes it is good.
Hi all, I got same issue when i start only this command: Get-User -ResultSize unlimited | Where {$.SKUAssigned -eq "TRUE" -and $.UserAccountControl -eq "NormalAccount"}
The result is: Where : The term '$.SKUAssigned' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:34
+ CategoryInfo : ObjectNotFound: ($.SKUAssigned:String) [Where-Object], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.WhereObjectCommand
Any idea how reslove it?
Hi!
There is a _ character missing after $ signs. For some reason Github cut it out from comment..
Attached in right format as picture.
@Bananovics Thank you very much for your realy fast help! It works perfectly. We can close case.
Hi Ryan!
If possible how can I reach that only AD enabled user accounts create as contacts with your script? Currently if a user left the company and the phone number which was belinging to him/her moved to another user the same phone number will present on both contacts. Thats why I would like to create contacts only for AD enabled users as those who left the company are in disabled state.
Cheers!