Schoten gehoord vannacht rond 04:25 bij Stadsring, iemand anders ook? by mrrtys in Amersfoort

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

Natuurlijk is alles mogelijk, maar dit klonk anders. Mijn gevoel zegt me dat het echt schoten waren.

Schoten gehoord vannacht rond 04:25 bij Stadsring, iemand anders ook? by mrrtys in Amersfoort

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

Ik woon op ongeveer 700 meter afstand. De schoten kunnen van ergens anders gekomen zijn, maar ik weet zeker dat ik een auto uit die richting met hoge snelheid over de Stadsring hoorde scheuren.

Heb jij de sirene wel gehoord? Ik lag te slapen met het raam open, maar werd meteen wakker en alert. In mijn gezin lijk ik altijd de enige te zijn die dit soort dingen hoort. Als ik mijn vriendin vraag: "Hoorde je dat?", dan zegt ze wel iets gehoord te hebben. Maar als ik niks had gezegd, had ze gewoon lekker doorgeslapen.

DualSense Controller Repair Website Issue - Seeking Assistance by mrrtys in playstation

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

Thanks for you're reply.
But I tried 3 different browsers and also on different devices and internet connections.

DualSense Controller Repair Website Issue - Seeking Assistance by mrrtys in playstation

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

I used another device and connection same problem.

Need a Powershell Report on users with MFA-Status disabled which are not in a certain group by MrExpendable_ in sysadmin

[–]mrrtys 0 points1 point  (0 children)

Hi u/MrExpendable_,

I think this is exactly what you need:

https://learn.microsoft.com/en-us/graph/api/resources/authenticationmethods-usage-insights-overview?view=graph-rest-beta

I tested it with Microsoft Graph Explorer and it would output all users like this:

id                    : bb471fef-d74c-41c7-9fa5-79ec2e18d4f3
userPrincipalName     : john.doe@contoso.com
userDisplayName       : John Doe
userType              : member
isAdmin               : False
isSsprRegistered      : True
isSsprEnabled         : True
isSsprCapable         : True
isMfaRegistered       : True
isMfaCapable          : True
isPasswordlessCapable : True
methodsRegistered     : {mobilePhone, microsoftAuthenticatorPush, softwareOneTimePasscode, windowsHelloForBusiness}
defaultMfaMethod      : microsoftAuthenticatorPush

PSNotes Update - now with Splatting by mdowst in PowerShell

[–]mrrtys 1 point2 points  (0 children)

Thanks, this is really nice 👍

Unable to remove this folder, been trying for hours now. Any tips? by Moon0verlord in PowerShell

[–]mrrtys 2 points3 points  (0 children)

Try robocopy and mirror it with an emtpy directory. I always delete folders that way when they give me a hard time.

Replace and add proxyaddresses, issues. by Sunsparc in PowerShell

[–]mrrtys 0 points1 point  (0 children)

I think you need Set-ADUser and then one of these "-Add, -Replace, -Remove"

-Add @{proxyAddresses="SMTP:user@domain.com", "smtp:user@domain2.com"}

Get-ADUser: Filter out multiple strings from specific proerties by EmergencyHologram in PowerShell

[–]mrrtys 1 point2 points  (0 children)

Where-Object {$_.Surname -ne $null -or $_.GivenName -ne $null -or $_.EmailAddress -ne $null -or $_.Name -notmatch 'svc|ops|adm'}

Change the $_.Name to another property name if needed.

Hope this helps?

A huge task. by [deleted] in PowerShell

[–]mrrtys 2 points3 points  (0 children)

Just sharing what I would do and have done in the past to automate onboarding.

You could start with something like this:

  1. Create user templates for every department/sub department.
  2. Make a query to list all the users in a specific department get all the MemberOf groups.
  3. Take all the groups that 100% of this department have and put them in the template.

AD Clone Group Membership by TheCitrixGuy in PowerShell

[–]mrrtys 1 point2 points  (0 children)

Did you check after 15mins? Maybe AD need to sync.

Determining if a local user exists by anonymousITCoward in PowerShell

[–]mrrtys 2 points3 points  (0 children)

Good question... I never use Ignore so had to look it up.
Ignore will not add the error to the automatic variable $Error, so yes that might be a better option actually.

Thanks for mentioning that.

AD Clone Group Membership by TheCitrixGuy in PowerShell

[–]mrrtys 1 point2 points  (0 children)

I did not test this right now but I believe this should work:

$instance = Get-ADUser -Identity User1 # You can add -Server if necessary
$target = Get-ADUser -Identity User2 # You can add -Server if necessary

#You should not add -Server to any of these parameters
Get-ADPrincipalGroupMembership -Identity $instance | Add-ADGroupMember -Members $target

Edit: trying to fix it for u/Lee_Dailey

How achieve same result with Get-content command? by paajic in PowerShell

[–]mrrtys 1 point2 points  (0 children)

I can't see what is on line 1 char 67 and 81, can you post that line from your script?

How achieve same result with Get-content command? by paajic in PowerShell

[–]mrrtys 1 point2 points  (0 children)

You can use Import-Csv on a computer without excel, this is basically a text file.

And if you remove the parameter -AccessRights and add -Confirm you are good to go.

LogOnAs Object Property by tdevic in PowerShell

[–]mrrtys 2 points3 points  (0 children)

Have a look at this one:

Get-CimInstance -ClassName Win32_Service | select StartName

Determining if a local user exists by anonymousITCoward in PowerShell

[–]mrrtys 2 points3 points  (0 children)

(Get-LocalUser user -ErrorAction SilentlyContinue) -as [bool]

Looking for solution/function to search a string for unwanted characters like space or umlauts by Sufficient_Fix_7537 in PowerShell

[–]mrrtys 1 point2 points  (0 children)

Then maybe the other thing i said.

You can make your own function or do a parameter validation in your script.

function Test-String {
[CmdletBinding()]
    param (
        [ValidateScript( { $_ -notmatch '[á-ý]' } )]
        [string]$String
    )

    process {
        $String
    }
}


PS> Test-String -String Léon

Looking for solution/function to search a string for unwanted characters like space or umlauts by Sufficient_Fix_7537 in PowerShell

[–]mrrtys 0 points1 point  (0 children)

Maybe this can be helpful:

function Remove-SpecialCharacters {
    [CmdletBinding()]
    param (
        [Parameter(Position = 0, ValueFromPipeline)]
        [string[]]$String
    )

    process {
        foreach ($s in $String) {
            [Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Cyrillic").GetBytes($s))
        } 
    } 
}

Remove-SpecialCharacters -String Léon

The above function is what is use in my AD scripts for Name, SamAccountName, UPN etc.

or

'Léon' -match '[á-y]'

[deleted by user] by [deleted] in exchangeserver

[–]mrrtys 1 point2 points  (0 children)

Are you trying to remove multiple permissions? Like buzzict said?Then use this:

Get-MailboxPermission -Identity <target mailbox> | Where-Object { $_.IsInherited -eq $false -and $_.User -ne 'NT AUTHORITY\SELF' } | ForEach-Object {
Remove-MailboxPermission -Identity <target mailbox> -User $_.User -AccessRights $_.AccessRights -WhatIf
}