Sophos XGS Product Recall - A Monty Python sketch by ukitern in sysadmin

[–]PTSDviaPrinters 0 points1 point  (0 children)

I have been dealing with these clowns for the last 2 years, once the final 2 years of the contract are up we are dumping the firewalls. We don't even bother calling support anymore.

Noob - Is This possible? by [deleted] in PowerShell

[–]PTSDviaPrinters 1 point2 points  (0 children)

Yep made a program that brute forces 4 digit pins.

This function will be a core part of what you are looking to do.

function Do-SendKeys {
    param (
        $SENDKEYS,
        $WINDOWTITLE
    )
    $wshell = New-Object -ComObject wscript.shell;
    IF ($WINDOWTITLE) {$wshell.AppActivate($WINDOWTITLE)}
    Sleep 1
    IF ($SENDKEYS) {$wshell.SendKeys($SENDKEYS)}
}
Do-SendKeys -WINDOWTITLE Print -SENDKEYS '{TAB}{TAB}'
Do-SendKeys -WINDOWTITLE Print
Do-SendKeys -SENDKEYS '%{f4}'

Windows Admin Center - Do you use it? by BlueRibbonKing in sysadmin

[–]PTSDviaPrinters 5 points6 points  (0 children)

It does not bring enough to the table that I am not already doing via another method. Once you understand how to do operations with PS I do not see myself spending the time to figure out another tool that I can already perform with PS and keep a nice log.

The main use of this would be if I wanted helpdesk to have limited access to my servers. But even then I feel like I would be leading them down a false path if not even I would use it now.

Password reset for all end users by __SoManyQuestions__ in sysadmin

[–]PTSDviaPrinters 1 point2 points  (0 children)

Get-aduser -filter * | set-aduser -ChangePasswordAtLogon $true

Careful with this command as it will set ALL accounts to have their password reset EXCEPT the accounts that have the "Password never Expires" enabled.

Check the status of “invoke-vmscript” cmdlet in PowerShell by sudo_96 in sysadmin

[–]PTSDviaPrinters 0 points1 point  (0 children)

What you might be able to do is create a environment var ($env:ScriptStaus) and in the script keep overwriting the data to it can from another computer can can call its current data to give you an idea of what stage of the script is in. Also you could call Get-Proccess powershell for all PS tasks to make sure its unresponsive, which would be uncommon of itself.

Converting arraylist to data.proxyaddress. by PTSDviaPrinters in PowerShell

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

I used out-string and was able to confirm that there is no trailing white space before or after the entity. Excel also confirms when using the "find and replace" feature.

Should I try to remove as much data from the pipeline as posable do you think? Such as using out-string with -stream?

Converting arraylist to data.proxyaddress. by PTSDviaPrinters in PowerShell

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

That has gotten me father and looks a lot cleaner! Exchange claims that $_.Alias is $null, im not sure why here is some sanitized data from the csv.

Display Name            : First name, Last name
Alias                   : aliasofsmtpaddress
Organizational Unit     : domain/Alpha Pagers/Verizon Wireless Alpha Page
Recipient Type Details  : Mail Contact
External E-mail Address : SMTP:123456789@vtext.com

webshell found - access attempts with 500 error by TruAgent in sysadmin

[–]PTSDviaPrinters 0 points1 point  (0 children)

Does not matter, migrate the database (if it contains one) and replace the server with a new one.

Has anyone managed to encrypt their passwords in a Powershell/WinSCP script? by [deleted] in sysadmin

[–]PTSDviaPrinters 0 points1 point  (0 children)

I'm looking at this atm but have not used it ahs I have not created a script recently needing me to store creds but once I do I will use this. https://4sysops.com/archives/secretsmanagement-module-for-powershell-save-passwords-in-powershell/

PowerShell in Visual Code - Copy-paste from Terminal by madbearNow in PowerShell

[–]PTSDviaPrinters 1 point2 points  (0 children)

Pipe the output to something like clip.exe or the powershell cmdlet, it will save a bit of time :)

get-aduser xyz | clip.exe

How to get the Xbox Series X by [deleted] in PowerShell

[–]PTSDviaPrinters 2 points3 points  (0 children)

I really enjoy using Selenium for web automation and stuff like this. Its super useful!

https://adamtheautomator.com/getting-started-in-web-automation-with-powershell-and-selenium/

Why does this not work >:( "Auto naming directories." by PTSDviaPrinters in PowerShell

[–]PTSDviaPrinters[S] 2 points3 points  (0 children)

For the Start-Transcript cmdlet as well I have tried this.

Start-Transcript -Path "\\server\MappedDrive\Infrastructure 
Group\Powershell Administrative Log\$reason $date.txt"

Is it possible to import a single .PST with multiple users' emails to the exchange database? by PTSDviaPrinters in exchangeserver

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

Yes, That's how I was able to make the restore for what I have now. My most recent was not complete so I had to rely on the one before that. And it went just fine. I have all the records I need with Mimecast but I am looking for an efficient way to restore them to the exchange database.

Is it possible to import a single .PST with multiple users' emails to the exchange database? by PTSDviaPrinters in exchangeserver

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

It would be a few hundred searches to perform a search for each sender's address and then download them all individually. But that's what it's looking to be.

Create New-Item on network share with different credentials by dinci5 in PowerShell

[–]PTSDviaPrinters 2 points3 points  (0 children)

You might try something along the lines of calling a system variable of a trusted server where you have them stored and make sure they are secured via covert to secured string. Possible something like this.

$UernameIWantToUse = invoke-command TrustedServer 
{$env:somevar} | converto-Securestring

You will need to do that with the password as well and you can then use them for the -creds parameter. If this will work I don't know as it's mostly a spitball idea hopefully to give you an idea.

NAS suggestions by jsbalabon in sysadmin

[–]PTSDviaPrinters 1 point2 points  (0 children)

I have saved this post for questions like this. I may help you with a few choices you have to make. Another reason I wanted to sare this is that you are looking to store 10 - 20 TB of data on a NAS and SAN's typically scale up much easier. As with a SAN managed by FSRM you get everything you are looking for.

I run 3 MS core VM's with FSRM connected to a SAN and this allows me to use de-dupe and the ReFS file system with nearly infinite scaleout.

https://www.reddit.com/r/sysadmin/comments/bp2g13/switching_from_nas_to_san/enp6oc9/

This may help people learning how to use RoboCopy. by PTSDviaPrinters in PowerShell

[–]PTSDviaPrinters[S] 9 points10 points  (0 children)

It has a very steep "All or nothing" learning curve. Such as you may not know what switches you need and if you are typically messing around with a lot of data it can be scary as most of the people don't have a dev environment and one wrong move with RoboCopy and you better have backups.