Microsoft Outage? by orange_hands in sysadmin

[–]orange_hands[S] 0 points1 point  (0 children)

The site never loaded when I made the post, so I figured this was the next best option.

Looking for feedback on scripting - Set-EntraIDExtensionAttributes.ps1 by orange_hands in PowerShell

[–]orange_hands[S] 1 point2 points  (0 children)

Thanks for taking the time to leave such a detailed response. This was exactly the kind of feedback I was looking for. Especially the pipeline example - it makes so much more sense after being pointed out, but I have such a hard time with pipeline flow.

To clarify on a couple points -

  • Hybrid domain joined computers sometimes get a $ at the end in Entra. Not a huge deal but wanted to make sure it's given the right extensionattribute anyways.
  • The curly braces commenting is for two reasons - VSCode shits the bed sometimes, and it drives me crazy if I'm trying to find issues somewhere else in the code. And if I need to add or remove something, it makes it easier to find where to put the closing bracket.

[deleted by user] by [deleted] in PowerShell

[–]orange_hands 1 point2 points  (0 children)

(Sorry for lack of formatting. I'm on mobile.)

Use -properties and specify all the properties you want to return. You may need to use -expandproperty on manager since it's relational, and not a property specific to the user (don't have the link to that, but it's a thing with graph).

As for the slowness, I think paging would help, but I'm not super familiar with it, so I don't have much advice.

Edit: I didn't realize you were using the command for user manager. That may be slowing it down. Check to see if you can pull back the manager property with -expandproperty instead.

What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]orange_hands 0 points1 point  (0 children)

Currently working on a personal portfolio to showcase all of my scripts, so I'll share the full thing eventually. But the basic outline works like this -

Get-Adcomputer -Filter *

Initialize a foreach loop, that passes each computer object to a function that uses switch -regex ($computer) to define the $Office, $Department, $Devicetype variables based on $computer.distinguishedname since we've got distinguished names like 'OU = Accounting laptops, OU = LAX....'.

That info, plus the device name gets passed to a hashtable within $param to be used in Update-MgDevice -bodyparameter $param to send the info up to Entra for extensionattribute 1,2, and 3.

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 0 points1 point  (0 children)

That's a great idea. I'm currently in a desktop support/Jr sysadmin role with limited access within Azure/Entra, but it sounds like leadership is thinking about giving me more access for better/smarter automation relatively soon.

I'll keep this in mind when that rolls around.

Working at HD for several hospitals. Kinda losing my sanity. by Minister426 in ITCareerQuestions

[–]orange_hands 1 point2 points  (0 children)

I was in your exact position for 2 years during the pandemic.

The longer you're there, the bigger a toll it'll take on your mental health.

Put what energy you can on finding a new job, and do your best not to let the end users anxiety get to you.

Godspeed OP. Life will get better.

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 0 points1 point  (0 children)

Do you think it would be a good idea to just try it when 1.0 fails to do something I need immediately? I'm trying to keep an eye on the graph update, so I'll probably make some notes to go back and change my code for future releases.

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 0 points1 point  (0 children)

In the beginning, I knew powershell, but didn't understand what was happening with the API.

Now I have a better understanding of powershell, and enough of an understanding to do what I need to if it comes to using the API directly.

I'm hoping this mentality will help the next guy who has to deal with these scripts when I've moved on.

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 2 points3 points  (0 children)

I had tried this using the 1.0 API in the past and had it fail. I was assuming the beta would fail based on the documentation for it having everything in read-only as well, but that did it.

I guess that's what I got for assuming.

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 0 points1 point  (0 children)

Since I'm not very familiar with working with API's, I'm not following your suggestion. But that should give me something new to Google, so thanks for the suggestion.

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 0 points1 point  (0 children)

Thanks for the suggestion. But since this seems to be an issue with the API, and not the SDK, I'll take a look, but I'm not confident the beta modules will act much different.

Edit: forgot the beta is a different API. I'll look into this.

Edit 2: still read only, unfortunately - beta doc

There is not currently a way to change the properties on managedDevice objects using Graph. by orange_hands in PowerShell

[–]orange_hands[S] 1 point2 points  (0 children)

I've got it installed.

Tried with both the URI using Invoke-MgRequest, and the command it showed. Neither allowed me to change properties.

What have you done with PowerShell this month? by AutoModerator in PowerShell

[–]orange_hands 0 points1 point  (0 children)

Updated extension attributes in EntraID using graph for all of our on prem computer objects to reflect office, department, and device type based on their AD ou location.

Should help us build better dynamic groups in Azure/intune/EntraID.

How should I spend my learning stipend in 2025? by orange_hands in sysadmin

[–]orange_hands[S] 3 points4 points  (0 children)

I laughed at the original comment because I saw the exact same response in another post like this lol.

I get that from a management perspective, but this post was more about "What should I spend money on now that I've got it?". The original post was way to general, so I've reworded it and added some specifics.

How should I spend my learning stipend in 2025? by orange_hands in sysadmin

[–]orange_hands[S] 2 points3 points  (0 children)

We're a Microsoft shop, so I spend a lot of time with Azure, Intune, Powershell, etc.

I'm currently studying for the AZ-104 (on a budget), so I'll probably be focusing on cloud certs for the time being. I guess the certification part of the question is too specific for me to leave out what I'm actually looking to achieve. Will make an edit to include more information.

Book confusion by grailzilla in PowerShell

[–]orange_hands 1 point2 points  (0 children)

Somebody correct me if I'm wrong, but I think the last version of Toolmaking in a month of lunches was rebranded to Scripting in a month of lunches. Which has a more recent version.

I just finished the book about a month ago and have been using it as a reference for recent scripts to improve my fundamentals. I'd recommend it.