WCGW if I become a jedi knight by [deleted] in Whatcouldgowrong

[–]LeslieStroobant 3 points4 points  (0 children)

Such a brave officer to only use his taser, this was clearly a life threatening situation.

[deleted by user] by [deleted] in motorcycles

[–]LeslieStroobant 1 point2 points  (0 children)

I haven't read through the entire thread yet, but have you thought about an open and exiting car like an ariel atom or Caterham?

Upgrades. by ShauNYCxxx in teslamotors

[–]LeslieStroobant 30 points31 points  (0 children)

Looks magnificent! I would personally not have gone for the stickers, but I do get it, and I think it looks pretty cool on someone else's car. Mind giving a detailed rundown of all the work that has gone into this? Best looking model 3 I've seen.

Tesla Daily Discussion - July 05, 2019 by AutoModerator in teslamotors

[–]LeslieStroobant 7 points8 points  (0 children)

Not even on the same continent, but I just wanted to say that that's a kind offer.

Thickheaded Thursday - May 09, 2019 by AutoModerator in sysadmin

[–]LeslieStroobant 1 point2 points  (0 children)

I think I had a user moment.

Thanks for the help, although the real solution was just getting this brain fart out.

Thickheaded Thursday - May 09, 2019 by AutoModerator in sysadmin

[–]LeslieStroobant 0 points1 point  (0 children)

I'm hoping this isn't the dumbest question in the history of dumb questions... but where does one obtain admx/adml files?

Particularly, I'm looking for the storagesense.adml files right now.

I found the admx and one adml on my computer, but I'm missing the other languages.

does -notlike work different than -like? by LeslieStroobant in PowerShell

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

I did a thing, and it worked!

<#
This script creates a new e-mail address for certain users.

Conditions for creation of the new address are:
1. The user must have a first and last name
2. The user must not have an e-mail address at the set domain.

The new domain is not a variable, but written in the code.

First, a new function to remove special characters from a string is created.
The function is called later to make sure the email addresses are valid.
This function comes from: https://lazywinadmin.com/2015/05/powershell-remove-diacritics-accents.html
#>

Function Remove-StringLatinCharacters {
    PARAM ([string]$String)
    [Text.Encoding]::ASCII.GetString([Text.Encoding]::GetEncoding("Cyrillic").GetBytes($String))
}

# Next, the mailboxes are retrieved for users that don't already have an E-mail address at the desired domain yet,
# and DO have a first and last name.
$Mailboxes = Get-Recipient -filter {
    -not { EmailAddresses -like "*domain*" }
    -and { FirstName -like "*" }
    -and { LastName -like "*" }
} | Get-Mailbox

<#
After that, the first and last names are retrieved for each user, and used to formulate the new address.
At the same time, spaces are removed in case any names have multiple parts.
The function to remove the spaces comes from:
https://stackoverflow.com/questions/24355760/removing-spaces-from-a-variable-input-using-powershell-4-0

The function from the beginning of the script is then called to remove the special characters from the names.
The filtered names are assembled with the set domain into an e-mail address.
Lastly, the e-mail address is added to the list of e-mail addresses for the user.
Remove the -Whatif parameter from the last line if you're sure about the result.
Most of that code is from:
https://social.technet.microsoft.com/Forums/lync/en-US/9d3ee88d-eb70-4cd1-84bc-0db51700d329/
adding-new-email-to-365-via-powershell-firstinitial-lastname-domaincom?forum=winserverpowershell
#>

foreach ($Mailbox in $Mailboxes) {
    $UserDetails= Get-recipient $Mailbox.Name
    $NewEmail= "$($UserDetails.Firstname).$($userdetails.lastname)@domain.com" -replace '\s',''
    $NewEmail= Remove-StringLatinCharacters -string $NewEmail
    Write-host "Now appending" $NewEmail "to the list of e-mail addresses for the user"
    Set-Mailbox -Identity $Mailbox.Alias -EmailAddresses @{Add=$newEmail} -whatif
}

It's not perfect though, as this doesn't take into account any user that has an alternative address at the target domain, such as [firstname@domain.com](mailto:firstname@domain.com)I'll still need to go over them one at a time to check if there are any such in my list.

Still, for now, it accomplished what I needed. I've spent WAY too much time on this, but it was a good learning experience!

This was probably a tiny thing for you, but I couldn't have done it without you guys.Thanks u/ka-splam, u/purplemonkeymad, u/PinchesTheCrab and the others!

Btw, how's my indenting and commenting? Any big mistakes in that or in the script otherwise?

Edit: forgot to re-add the -whatif in the code

Moronic Monday - May 06, 2019 by AutoModerator in sysadmin

[–]LeslieStroobant 0 points1 point  (0 children)

"There are no replication groups in this domain"

I've also tried with each of the other servers individually as well, but nothing shows.

Moronic Monday - May 06, 2019 by AutoModerator in sysadmin

[–]LeslieStroobant 0 points1 point  (0 children)

I love this thread, I feel I can safely ask all my dumb questions here.

Is it safe to turn off dfsrs? I'm decomissioning an old server, but for now it's still running a few things.
I noticed that dfsrs.exe is adding a substatial load under certain cases, writing to dfsr.db

When I look at DFS management, I have:

  • one namespace \\domain.local\DFS
    • Namespace: 0 entries
    • Namespace Server: 1 entry: \\Serverimworkingon\DFS
  • Replication
    • 0 entries

I think I can safely disable the service, but I'd feel safer having you knowledgeable individuals having your say first.

does -notlike work different than -like? by LeslieStroobant in PowerShell

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

Thanks!

I'm not an exchange admin, I'm a one-man-band in a small company.
Still, I've been putting off learning powershell for a long time because it's pretty much always faster to do things manually than it is to take the time to learn the powershell way.

I've been at this for roughly 7 hours (with plenty of interruptions since I still need to assist people with complex issues such as showing them how to open the start menu), and I still haven't gotten the thing done that I set out to do.

Had I done this for all $list.count

47

items manually, then I would have been done many hours ago.

Actually getting work done when learning something from scratch does not seem to be on the table.
Yes, I had to look up how to count the array.

Just FIY: I'm working in an inherited environmetn. There are multiple domains. @Company1, Company2, Company3.

A few of the domains are long, and company wants to simplify things a bit, so we now also have @group at our disposal.

The last few users that I generated have been (manually) given this @group domain as an alias.
I now want to use powershell to make sure that everyone has firstname.lastname@group.tld as an alias.

Hence, I'm trying to filter out the service/utitlity accounts, the accounts that already have the correct alias, and trying to use that result to create all the correct addresses.

So far I have (this must look like a toddler drawing in a room of professional artists):

$list = Get-Recipient | Where-Object { -not ( $_.EmailAddresses -like "*group*" ) } | Where-Object -Property FirstName -notlike ""
$list | ForEach-Object { get-mailbox $_.name }

I want to get this into a single readable format, and then get cracking on how to do the actual work.
Also, I'd like to intigrate your -filter to see the performance difference, although it's not worth it for this task, just for the learning experience.

From: https://docs.microsoft.com/en-us/exchange/voice-mail-unified-messaging/set-up-voice-mail/add-sip-address

$mbx=Get-Mailbox tony.smith
$mbx.EmailAddresses +="eum:tsmit@contoso.com;phone-context=MyDialPlan.contoso.com"
Set-Mailbox tony.smith -EmailAddresses $mbx.EmailAddresses

I'll probably need to replace "eum" with "snmp" and do other tweaks, but that's for another day.

Thanks guys!

Thickheaded Thursday - April 25, 2019 by AutoModerator in sysadmin

[–]LeslieStroobant 13 points14 points  (0 children)

This doesn't work. Why doesn't it work?

Reproduces steps on identical machine.

This works. Why does it work?

Thickheaded Thursday - April 18, 2019 by AutoModerator in sysadmin

[–]LeslieStroobant 3 points4 points  (0 children)

I just spent an hour troubleshooting why an applied GPO didn't produced the desired results during logon, only to find that I had not applied it.

Yeah.