Closed ironbe4rd closed 4 years ago
Can you be more specific - where exactly are you looking?
Published version when I search for: Get-WinADProxyAddresses
GitHub version:
So where do you miss things or what is not working for you?
Unless you're looking for a use case:
$ADUsers = Get-ADUser -Filter * -Properties ProxyAddresses
foreach ($User in $ADUsers) {
Get-WinADProxyAddresses -ADUser $User
}
$ADUsers = Get-ADUser -Filter * -Properties ProxyAddresses
foreach ($User in $ADUsers) {
Get-WinADProxyAddresses -ADUser $User -RemovePrefix
}
Not all commands are publicly usable, I use them in other cases, that may not be obvious at first sight.
Ah i see now what you mean. That is how i ended up using it anyway. Usually with these functions I would expect the actual commands to get the property to be in the Function, here you are just formatting the data.
Well, I don't know what use case there may be for you. In this case, I'm requesting all users, but in others, I may request just couple of users that require fixing. When there are too many variables in place I usually just create helper function rather than do it all for me. In other cases, there's a full "fix it for me please".
While I have you. How do you use repair-winademailaddress?
I keep getting cannot find object on the username.
On Fri, Aug 14, 2020, 9:28 AM Przemysław Kłys notifications@github.com wrote:
Well, I don't know what use case there may be for you. In this case, I'm requesting all users, but in others, I may request just couple of users that require fixing. When there are too many variables in place I usually just create helper function rather than do it all for me. In other cases, there's a full "fix it for me please".
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EvotecIT/ADEssentials/issues/7#issuecomment-674074638, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYW63OH5UIJME2F7EHGGBDSAU3XJANCNFSM4P7O7MPQ .
Lemme fix this one. I see an edge case I've not thought of on this one.
This would be your use case
# Get a user
$User = Get-ADUser 'testing1' -Properties ProxyAddresses, EmailAddress
# You can optionally verify how it looks like or what is set
#Get-WinADProxyAddresses -ADUser $User | Format-Table
# Fix primary email address - it will be added to primary email field + proxy address as primary, existing addresses will be rearanged
Repair-WinADEmailAddress -ADUser $User -ToEmail 'testing2@evotec.xyz' -Display -WhatIf | Format-Table
-WhatIf shows what will happen -Display will give you an output like this:
For example:
# Get a user
$User = Get-ADUser 'testing1' -Properties ProxyAddresses, EmailAddress
# You can optionally verify how it looks like or what is set
#Get-WinADProxyAddresses -ADUser $User | Format-Table
# Fix primary email address - it will be added to primary email field + proxy address as primary, existing addresses will be rearanged
Repair-WinADEmailAddress -ADUser $User -ToEmail 'testing2@evotec.be' -Display -WhatIf | Format-Table
Without WHATIF
Update-Module ADEssentials. I've released one with fixes.
Thanks updates are greatly appreciated!
On Fri, Aug 14, 2020, 4:48 PM Przemysław Kłys notifications@github.com wrote:
Closed #7 https://github.com/EvotecIT/ADEssentials/issues/7.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/EvotecIT/ADEssentials/issues/7#event-3657651295, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANYW63I7K4QOOZTKJGB2P6LSAWPLTANCNFSM4P7O7MPQ .
you dont even have a command in these functions to get the data. get-winadproxyaddresses Get-WinADUserPrincipalName
perhaps others as well im not going to go through all of them