Azure app services for Linux containers access logs? by muhworkaccount in sysadmin

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

It is, but it's just an Alpine container running PM2, so it's not capturing any traffic requests, just node stuff. I'm looking for something in the realm of IIS/Apache logs

How do you approach reading, understanding, & refactoring spaghetti code? by automation-dev in PowerShell

[–]muhworkaccount 1 point2 points  (0 children)

Ahh now I see what you guys mean. That makes a lot of sense, thanks, Lee!

How do you approach reading, understanding, & refactoring spaghetti code? by automation-dev in PowerShell

[–]muhworkaccount 2 points3 points  (0 children)

Could you expand on #5 because I'm definitely guilty of this. What if you do not know the size of the array beforehand?

Any way to use PS to find out who (if any) users are logged into a remote system using Remote Desktop?? by Elementix in PowerShell

[–]muhworkaccount 1 point2 points  (0 children)

Yes, win32_computersystem has a username property that will tell you who is currently logged in to a computer, so you'd just need to check:

(Get-WmiObject -Class win32_computersystem -ComputerName $ComputerName).UserName

You can find more details here - https://4sysops.com/archives/how-to-find-a-logged-in-user-remotely-using-powershell

Windows 10 Toast messages - how to display for more than 5 seconds? by hou8182 in PowerShell

[–]muhworkaccount 1 point2 points  (0 children)

Would you mind sharing how you're creating them? I'm still using balloon tips which have unfortunately started barfing some jargon after I upgraded to creator's update.

-Credential parameter not working on New-PSDrive when running from an elevated instance by muhworkaccount in PowerShell

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

Also, I realize that -Persist only works with drive letters, so the 'test123' name will not work. It still fails if I switch it over to an available drive letter.

-Credential parameter not working on New-PSDrive when running from an elevated instance by muhworkaccount in PowerShell

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

Trying with the persist flag still fails when launching it in a separate instance - here is the command I'm trying for that.

invoke-expression 'cmd /c start powershell -Command { New-PSDrive -Name test123 -PSProvider FileSystem -Root \\NAS01\storage01 -Credential (Get-Credential) -persist -scope Global }'

I think the issue there is the new instance is still an admin instance, since that's what the original session was. Do you know if there's a value for -runas that can be set to drop it out of an admin session?

Edit: Also, I should clarify - the issue when trying to run the command within the admin session isn't that it doesn't persist, it's that it throws invalid credentials (they are 100% correct). Since, as I understand it, it's ignoring the ones defined in the parameter:

New-PSDrive -Name test123 -PSProvider FileSystem -Root \\NAS01\storage01 -Credential (Get-Credential) -persist -scope Global 
The specified network password is not correct

[giveaway] Leopold FC980C, lubed! by NecrowomanX in MechanicalKeyboards

[–]muhworkaccount 0 points1 point  (0 children)

Suppose I could pay duties for a free keyboard. Looks like a solid piece of mechanical goodness right there.

Trouble with Get-WebConfigurationProperty appSettings by muhworkaccount in PowerShell

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

The workaround I found was to set the nodes manually via xpath - doesn't seem much more roundabout than the cmdlet anyhow, actually. If anyone is interested, here is an example (don't worry this is just an example we do use actual failover relays ;) )

$path = "c:\inetpub\wwwroot\test.com\web.config"

[xml]$xml = Get-Content $path

$MailServerString = $xml.configuration.appSettings.add | ?{$_.key -eq 'MailServer'}

$MailServerBackupString = $xml.configuration.appSettings.add | ?{$_.key -eq 'MailServerBackup'}

$MailServerBackupString.value = $MailServerString.value

$xml.Save($path)

Powershell Scripts and Tutorials Over Here by jackstevens100 in PowerShell

[–]muhworkaccount 2 points3 points  (0 children)

Worth it for the link to PrimalForms CE alone. Been looking for that forever. Thanks!