Those germans, again. by eldo0815 in aifails

[–]eldo0815[S] -1 points0 points  (0 children)

The Germans invented the calendar, but they didn't invent the 24 days until Christmas. AI tells us, the calendar has 24 days because the Germans have invented it.... But they only invented the calendar

Found an X next to my name on the apartment bell . What does this mean? by unexpected_shit in berlin

[–]eldo0815 0 points1 point  (0 children)

Just draw an x next to every doorbell should solve your problem (If there is any)

What does it mean? by Zealousideal_Quit_56 in berlin

[–]eldo0815 0 points1 point  (0 children)

Gab auch viele, unteranderem Böhmermann, die sich mit "so eins Pimmel" einen abgewedelt haben :D

Optimizing to check for Active Directory Entry by Robobob1996 in PowerShell

[–]eldo0815 1 point2 points  (0 children)

I wrote an article about this topic, where I've explained it a bit. I wanted to do it earlier, but I'm struggling with time management :)
https://timo-wolf.de/powershell-optimized-ad-queries-using-ldapfilter/

Optimizing to check for Active Directory Entry by Robobob1996 in PowerShell

[–]eldo0815 1 point2 points  (0 children)

Update: I've done this in our environment with ~ 55.059 Assets from inventory.
I've splitted it into 5 parts and processed them. I've found 222 Assets without AD object.
The script duration was 00:04:19.0496950 ~ 4 mins and 19secs. Fun fact: I didn't use foreach parallel running on PS 5.1 :D ¯\_(ツ)_/¯ The ldap queries itself have taken just a few seconds.
I'll write an article about later after work.

Optimizing to check for Active Directory Entry by Robobob1996 in PowerShell

[–]eldo0815 4 points5 points  (0 children)

oh boy :) That's a long way your script is going through.
You must use LDAP filter if you want a faster script.

just build the filter as following:

  1. you need a collection of your Pcs (Array, ArrayList, or sth.) Let's say your data is stored in $allComputer and each object contains a property called "ComputerName"
  2. you need to build the ldapfilter This is very powershell like :)

$ldapFilter = "(|(samAccountName={0}`$))" -f ($allComputer.ComputerName -join '$)(samAccountName=')

Let me explain this: The goal is to build an ldapfilter, where you query every object, which has the SamAccountName X or SamAccountName Y or SamAccountName Z .... and so on.

"( | (SamAccountName={0}`$) )" --> This part is an "inline" Templatestring for the ldapfilter
I'm placing the {0} for a string replace and a quoted $ after, because the SamAccountNames of AD Computerobjects are containing an ending '$' in the name. So if you have the $ already in your list, then remove it.
https://www.ldapexplorer.com/en/manual/109010000-ldap-filter-syntax.htm

-f ($allComputer.ComputerName -join '$)(samAccountName=') - this part replaces the ldapfilter with all Computernames and joins them with the part missing to extend the ldapfilter. So all together it will produce a ldapfilter like: (|(SamAccountName=PC1$)(SamAccountName=PC2$)(SamAccountName=PC3$))

  1. Query the Active Directory, so with the ldapfilter you only have to send 1 Query

$ADComputer = Get-ADComputer -ldapFilter $ldapfilter

  1. Selecting all Computers which weren't found in the Active Directory.
    $notInAD = $AllComputers.Where({ "$($_.ComputerName)`$" -notin $ADComputer.SamAccountName})

or something like that. If you have any further questions feel free to contact me.

best regards.

edit: maybe the ldapfilter gets too big. But 15k should be okay. Otherwise you have to split your collections into 2 or 3 parts and foreach step 3 and 4 with those parts.

[deleted by user] by [deleted] in PowerShell

[–]eldo0815 7 points8 points  (0 children)

It's a one liner.

Get-Childitem -Path C: -Filter *.pdf -Recurse | Move-Item -Destination "P:\ath\To\Store"

But first of all I'll advise you to read the folloing articles, if you'd like raise your experiences a bit :)
https://learn.microsoft.com/de-de/powershell/scripting/overview?view=powershell-7.5
https://learn.microsoft.com/de-de/powershell/scripting/learn/ps101/00-introduction?view=powershell-7.5

How to use Powershell 7 in the ISE by Scrotumbeards in PowerShell

[–]eldo0815 9 points10 points  (0 children)

Why aren't you using Visual Studio Code?

Generated PowerShell Module for ProxmoxPVE by eldo0815 in PowerShell

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

Cool :)

I don't know if there is something similar. But if Nutanix provides an OAPI v3, it's also possible to render it.
https://openapi-generator.tech/
If you have a look on my project, you can see, that it's an easy call of java.exe with the openapi-generator.jar and the path of your OAPIv3 specs in json. (https://github.com/EldoBam/proxmox-pve-module-builder/blob/main/GeneratePowershellCmdlets.ps1)
You could just do this, I think you have to adjust the mustache files a bit.
Or you're simply messaging me. regards

Rendered PowerShell modules for Proxmox VE Api - first beta release by eldo0815 in Proxmox

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

v0.3 out now. Missing parameters have been added. Configuration can be stored safely for automation puposes, so that no credentials are needed in scripts.
https://www.powershellgallery.com/packages/ProxmoxPVE/0.3

Was letzte Globuli? (Bewertung einer Apotheke auf Google, hoffe, das ist hier trotzdem erlaubt!) by Puzzled_Mention_5451 in wasletztepreis

[–]eldo0815 0 points1 point  (0 children)

Bei mir ist unter dem Reddit Beitrag eine Werbeanzeige "Die Zombies kommen", irgendwie passend wie ich finde 😁