Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-AzureADUser - setting null value for attribute #166

Open
akemball opened this issue Nov 15, 2017 · 16 comments
Open

Set-AzureADUser - setting null value for attribute #166

akemball opened this issue Nov 15, 2017 · 16 comments

Comments

@akemball
Copy link

@akemball akemball commented Nov 15, 2017

With the Set-MsolUser cmdlet, it is possible to set an attribute to "$null" to clear the value. E.g.
Set-Msoluser -userprincipalname -Mobile "$null" will clear whatever value is present for the Mobile phone.

But Set-AzureADUser -objectid -Mobile "$null" will generate an error.

set-AzureADUser : Error occurred while executing SetUser
Code: Request_BadRequest
Message: Invalid value specified for property 'mobile' of resource 'User'.
RequestId: e7c1d0eb-de00-4ab7-bf8b-5b7d9efbfa4e
DateTimeStamp: Wed, 15 Nov 2017 12:56:36 GMT
Details: PropertyName - mobile, PropertyErrorCode - InvalidLength
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
At line:1 char:1
..........

Using AzureADPreview 2.0.0.137

Thanks

@RobdeJong

This comment has been minimized.

Copy link
Collaborator

@RobdeJong RobdeJong commented Nov 15, 2017

@egbertvanderhout

This comment has been minimized.

Copy link

@egbertvanderhout egbertvanderhout commented Mar 8, 2018

So... how do I empty those properties?

@thuld

This comment has been minimized.

Copy link

@thuld thuld commented Mar 8, 2018

Are you going to fix this defect? Currently do we need to "remove" values by setting the value to " " which is not perfect

@RobdeJong

This comment has been minimized.

Copy link
Collaborator

@RobdeJong RobdeJong commented Mar 8, 2018

@RobdeJong

This comment has been minimized.

Copy link
Collaborator

@RobdeJong RobdeJong commented Mar 12, 2018

@alex-3sr

This comment has been minimized.

Copy link

@alex-3sr alex-3sr commented Aug 22, 2018

Hi,

can we have an update of this issue please ?

Thanks,
Alex

@TiloGit

This comment has been minimized.

Copy link

@TiloGit TiloGit commented Oct 18, 2018

same today with 2.0.1.16

Name              : azuread
Path              : C:\Program Files\WindowsPowerShell\Modules\azuread\2.0.1.16\Microsoft.Open.AzureAD16.Graph.PowerShell.dll
Description       : Azure Active Directory V2 General Availability Module.
                    This is the General Availability release of Azure Active Directory V2 PowerShell Module.
                    For detailed information on how to install and run this module from the PowerShell Gallery including prerequisites, please refer to
                    https://msdn.microsoft.com/powershell/gallery/readme
ModuleType        : Binary
Version           : 2.0.1.16
@jecarlsen

This comment has been minimized.

Copy link

@jecarlsen jecarlsen commented Oct 31, 2018

We're doing this quite often on a number of customers users moving from onprem to Cloud only. We too use " " instead of NULL which still works.
Please don't break this 'feature' while we're waiting for a valid NULL assignment feature.

@memonjur

This comment has been minimized.

Copy link

@memonjur memonjur commented Dec 17, 2018

Instead of this:
Set-AzureADUser -ObjectId -Mobile "$null"

Use this:
Set-AzureADUser -ObjectId -Mobile $null

@Terrenus

This comment has been minimized.

Copy link

@Terrenus Terrenus commented Dec 18, 2018

Instead of this:
Set-AzureADUser -ObjectId -Mobile "$null"

Use this:
Set-AzureADUser -ObjectId -Mobile $null

Doesn't work for me. It doesn't give any error message prompt, but it doesn't neither clean the mobile field. I tried to wait a few minutes if it was caused by redundancy, but it didn't change after waiting 30 minutes.

@dougraheem

This comment has been minimized.

Copy link

@dougraheem dougraheem commented Jan 8, 2019

@Terrenus try following, I had similar requirements.

 Set-AzureADUser -ObjectId $line.UserPrincipleName -City " "

Hope it helps.

@Terrenus

This comment has been minimized.

Copy link

@Terrenus Terrenus commented Jan 9, 2019

@dougraheem It works, kinda...

Unluckily we have a script from the background that recognise " " as a space, and not as a null or empty field.. Which is what I need. I guess I need to wait for an update or something similar from it.

Thanks for the hint :-)

@sankamm

This comment has been minimized.

Copy link

@sankamm sankamm commented May 2, 2019

@dougraheem

any update since 2017?

@alexandermainz

This comment has been minimized.

Copy link

@alexandermainz alexandermainz commented Aug 8, 2019

Any news with this issue?

I accidently set the "ImmutableId" field to a value and cannot use the "workaround" and set a white space in this field, because it has to be a unique value for alle AD identites in the tenant...

@sbgillett

This comment has been minimized.

Copy link

@sbgillett sbgillett commented Oct 25, 2019

Why is this still not possible?

@emekm

This comment has been minimized.

Copy link

@emekm emekm commented Nov 27, 2019

after 2 years from the first request the BUG still exists.
It is really strange that we can set null from GUI, but not using remote powershell!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.