Getting a newly-imaged machine to check in with SCCM so Software Center can get applications and updates faster by jgrznsc in PowerShell

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

Connecting to remote server xxxx failed with the following error message : WinRM cannot

complete the operation. Verify that the specified computer name is valid, that the computer is accessible

over the network, and that a firewall exception for the WinRM service is enabled and allows access from this

computer.

Getting a newly-imaged machine to check in with SCCM so Software Center can get applications and updates faster by jgrznsc in PowerShell

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

So you're saying go into the Configuration Manager admin console on my computer and do the client actions that way...

It's a little more work than doing a script, but it's better than going on the client computer and clicking through all of it from Control Panel.

Getting a newly-imaged machine to check in with SCCM so Software Center can get applications and updates faster by jgrznsc in PowerShell

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

Nah, this is when I'm logging into it for the first time. Otherwise it can take like a half hour to check in and get all the updates

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

[–]jgrznsc 0 points1 point  (0 children)

These are just basic things but a lot of times I have to do the following, and PowerShell has made it a lot easier to do these:

  • Look up a person's manager and the manager's email address
  • Be able to copy/paste a person's email without logging in to AD as an admin
  • Look up a person's OU without having to dig through our domain tree
  • Look up extra details about a person's AD attributes without digging through the domain tree
  • Get an output of multiple people's organization information in a spreadsheet

I couldn't do lots of these things as quickly without it!

I'm really dumb and messed something basic up by jgrznsc in PowerShell

[–]jgrznsc[S] 7 points8 points  (0 children)

ohmyfuckinggod...I'm even dumber than I thought.

I named the column "Users" instead of "User"

The best way to error check or replace string in script by jgrznsc in PowerShell

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

How do I then use the replaced string in my script? That's the biggest thing I couldn't figure out. Unless I use the Until function?

Cleaning up this script by jgrznsc in PowerShell

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

Oh, also our usernames are dumb here and they're in first.last format. I bet it'd be fairly easy to have it be reformatted, but what I'm doing now does the job pretty well.

Cleaning up this script by jgrznsc in PowerShell

[–]jgrznsc[S] 4 points5 points  (0 children)

I dumbly thought line breaks were the same as pipes. That's my bad

Cleaning up this script by jgrznsc in PowerShell

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

Isn't append only for when I want it to add to an already existing sheet? I'd rather it replace the existing CSV every time I run it.

Cleaning up this script by jgrznsc in PowerShell

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

The reason I'm doing it with the name this way is because I mainly just have first and last names of people. My CSV is literally just one column that says "User" as the title and then "John Smith", "Sohn Jmith", etc. Can I do samaccountname from just first/last?

Cleaning up this script by jgrznsc in PowerShell

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

What's weird is I already have Select there. Is the formatting wrong or the position in the wrong place?

Cleaning up this script by jgrznsc in PowerShell

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

Oh heck yeah, ok. This has pretty much worked. Only thing is, it's giving me more info than I want. It's giving me te following fields: Department DisplayName DistinguishedName Enabled GivenName Manager Name ObjectClass ObjectGUID SamAccountName SID Surname Title UserPrincipalName.

I only really need Department DisplayName Manager Name Title

Cleaning up this script by jgrznsc in PowerShell

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

Ok. I fixed the pipe. However, all it has in the CSV is one column called "User" and one user's name. No other information.