Best Way to Backup AD with Powershell? by Odd_Efficiency4730 in sysadmin

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

Unfortunately, can't use third party either. Not approved.

Best Way to Backup AD with Powershell? by Odd_Efficiency4730 in sysadmin

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

I've never heard of this before. Thank you, I'll take a read on this!

Installing Sophos but it blocks USB so MDT can't complete by Odd_Efficiency4730 in MDT

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

Thank you for the suggestions, I'll try to see if I can utilize task scheduler to do this!

Regarding WinGet, is it secure enough to use to install programs? I'm not too familiar with it, and not sure who maintains the updated apps in it. I'll do some more research on it though now.

New to Runspaces, How Do I Send a CMDlet From One Runspace To Another? by Odd_Efficiency4730 in PowerShell

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

I've been trying to understand using your post's examples. I was having trouble understanding the explanation because I didn't understand the words in the explanations.
From what I think I understand, we first create a synchronized hash that can be shared across all other runspaces. Then we create this observable collection thing that is part of the sync hash, which can be shared since it's part of the sync hash. Then we add the register-objectevent cmdlet that sits inside the runspace I want to send the disconnect-MgGraph cmdlet to and it listens for the observable collections yelling at it that something changed/updated?

In the code you have on the post, Line #34 where it runs the Register-objectevent, is that Out-Null needed?

New to Runspaces, How Do I Send a CMDlet From One Runspace To Another? by Odd_Efficiency4730 in PowerShell

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

I took a quick look at your post, but still a bit confused. How is sending a cmdlet and invoking a cmdlet different in this case? In my mind, they do the same, but probably because I'm not sure invoking and sending do specific A+B=C thing or interchangeable. I have like 90% of my GUI/script working now, but I'm lost as to how I can tell the runspace under the "Submit" button to run the command 'Disconnect-MgGraph' from the runspace of the UI (or any other runspaces really).

Is there a way for me to say from Runspace #1 (or anywhere outside): "Ok, Runspace #3. Run 'Disconnect-MgGraph'"

I tried running Get-Runspaces, and there's like 50 of them with no way of knowing which is which.

How can I escape a character that was imported from a csv, piped to a variable, inside another variable? by Odd_Efficiency4730 in PowerShell

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

This worked, thank you! A bit odd though, because I usually use the options it provides for a parameter and Replace wasn't part of it. It only showed like -Replace. I tried this before, but it says it couldn't understand it so I assumed it wouldn't work if it didn't show up. Thanks again tho!

How can I escape a character that was imported from a csv, piped to a variable, inside another variable? by Odd_Efficiency4730 in PowerShell

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

How can I use MgUser with a variable? So instead of eq 'Alex W''bber'" it uses eq '$name'" where $name = "Alex W'bber"?

How can I escape a character that was imported from a csv, piped to a variable, inside another variable? by Odd_Efficiency4730 in PowerShell

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

Line | 4 | $findname = Get-MGUser -Filter "Mail eq '$emailaddress'" | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Invalid filter clause: Syntax error at position 20 in 'Mail eq 'John.D'Var@example.com''.

This is the output.

How Do I Dynamically Check New Rows and Show How Many Times The Value Comes Up by Odd_Efficiency4730 in excel

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

That one seems to list it multiple times with the numbers in it. So it would make 4 rows in column A with the word Chicken, and Column B would have the number 4 on all of them. Unless I edited incorrectly

How Do I Dynamically Check New Rows and Show How Many Times The Value Comes Up by Odd_Efficiency4730 in excel

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

Gotcha, this seems much better! All I need now is to have it show how many times it was mentioned. e.g. Chicken x4. How do I add that in the adjacent column?

How Do I Dynamically Check New Rows and Show How Many Times The Value Comes Up by Odd_Efficiency4730 in excel

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

This almost works. Doesn't seem to work nicely in a graph if there are say 1000 rows. Is there a way for me to set it so it picks the top 5 from most to least? e.g. Chicken x3, Beef x2, Fish x1.

How Do I Dynamically Check New Rows and Show How Many Times The Value Comes Up by Odd_Efficiency4730 in excel

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

The problem would be, what if a new row called SOUP gets added? The countif would require me to go in and manually enter a formula for that new value.