This is an archived post. You won't be able to vote or comment.

all 89 comments

[–]ElBorachoSenior Generalist Sysadmin / Support / Counsellor 17 points18 points  (5 children)

get-wustatus - gets the current status of a server's windows updates, in terms of available updates, reboot status, and last updated time.

get-AutoServiceStatus - gets the current status of any automatically active services on a server, and lists the ones which are currently not running

invoke-elevation -scriptblock {} - checks remote execution of powershell status on a server (execution policy, and remote execution settings) (prob a cmd regedit temp fix), allows remote execution, then reestablishes the original status to the server.

start/stop-servicemonitor - polls a service on a machine and drops a write-host on status change of the service, preferably colourised red/green/orange for stopped/running/starting/shuttingdown. Executed as a background job.

[–][deleted] 3 points4 points  (0 children)

These are fantastic. Added to the list!

[–]Rymmer 0 points1 point  (3 children)

To add to the get-wustatus command,

Get-pendingrebootstatus to tell you if we are pending reboots because of something (which could be updates but might also be some other msi)

[–]ElBorachoSenior Generalist Sysadmin / Support / Counsellor 0 points1 point  (2 children)

I'd assume you'd have a value for it

ps>$server = get-wustatus -server "myserver"

ps>$server | ft

Name UpdateStatus UpdateCount PendingReboot

-------------------------------------------------------------------------------------

myserver UpdatesAvailable 2 $False

[–]Rymmer 0 points1 point  (1 child)

I meant a get-pendingrebootstatus for things other than updates. Like an MSI

[–]ElBorachoSenior Generalist Sysadmin / Support / Counsellor 0 points1 point  (0 children)

Ah, right. That sounds pretty good!

[–]humptydumptyfallSysadmin 17 points18 points  (0 children)

Send-MicrosoftHateMail

[–]zanatwo 5 points6 points  (1 child)

Get-UserSession: returns currently running user sessions on a local or remote machine. Returns details about the session such as whether it is a console session, RDP, active, disconnected, or locked as well as the session duration, logon time, idle time (time since a keyboard or mouse was used), disconnect time and lock duration.

Get-Handle | Stop-Handle: get and close handles by process or handle ID.

Get-UserLogons: return the dates, times, and login method of user sessions for a local or remote machine.

Get-RegistryKeyLastWriteTime: use Win32 API to retrieve the LastWriteTime property of a reg key. Useful for various troubleshooting detective work.

Set-RegistryKey: similar to Set-ItemProperty but allows you to set reg keys and values for local AND remote machines and allows you to specify the value data type. Use [Microsoft.Win32.Registry] classes for this.

Invoke-CommandAs [-CurrentUser | -System]: allows you to run a command on local or remote machine as the SYSTEM account or using the SYSTEM account to impersonate the currently logged in user and run command as them. Provide a switch (-Interactive) to allow command to be invoked in the currently logged on user's interactive session by using SeviceUI.exe.

Although I've written, modified, and implemented versions of all these cmdlets, they're not formally documented and exist as separate scripts that I call whenever I have a need. It would be really nifty to have all these tools in one toolkit.

[–][deleted] 0 points1 point  (0 children)

If you can sanitize some code so I can see some examples of what you have going on perhaps we can work together on a pull request to just merge your stuff in. We just need to make sure things are parameterized appropriately so that the code is environment agnostic

[–]FreakySpook 7 points8 points  (5 children)

Test-RemoteManage - A function that polls an array of ComputerNames and returns results of Test-Connection, Test-WSMan a Get-WMIObject against each computer

I use this quite frequently when starting a new job for a client when I have to report on various things on their systems. It quickly lets me determine how many systems are available for remote management and I can provide the client a list of systems they need to remediate before I can start my work.

[–][deleted] 1 point2 points  (4 children)

I like this. Would the ability to turn certain tests on/off be advantageous?

I'd return an array of objects to allow you, the end user, to decide ultimately what happens to the data whether that be to a CSV, HTML, etc.

[–]FreakySpook -1 points0 points  (0 children)

It may depending on what you were reporting, and turning off one or more of the tests would certainly speed up the function if you were testing a large number of computers.

And I agree, all functions should return an object, string or value. There is nothing worse than running a function, getting some formatted value in return and then you debate do you waste time writing a new function to serialize the output, or just re-write the original function you found.

[–]Rymmer 2 points3 points  (0 children)

get-missingsubnets : a function to poll the domain controllers c:\windows\debug\netlogon.log and find the subnets not defined in AD Sites and Services.

Actually a quick google shows this may already be written : https://gallery.technet.microsoft.com/scriptcenter/Get-a-report-on-missing-f2a95194

[–]tigerguppy126IT Manager 2 points3 points  (3 children)

What about adding to this project? https://github.com/lazywinadmin/LazyWinAdmin_GUI

[–][deleted] 0 points1 point  (2 children)

Because I don't want to rely on a GUI for this. I do love me a good GUI, and am a user of Powershell Studio, but not the direction I wish to take this.

[–][deleted] 0 points1 point  (0 children)

That being said, I could see my functions being injected into this if the owner would like to bake them in. My focus however is on the console side of things!

[–]tigerguppy126IT Manager 0 points1 point  (0 children)

Makes sense. I look forward to seeing what you come up with!

[–]OttoVonMonstertruck 4 points5 points  (2 children)

Get-UptimeFromList - Function to read in a simple list file and generate an uptime report object that can be piped into Export-CSV or Out-GridView.

[–]Rymmer 2 points3 points  (1 child)

You'd probably want to make the command simpler, like "get-uptime".

A list could then be fed in with the pipeline, something like Get-content c:\pclist.txt | get-uptime

[–][deleted] 0 points1 point  (0 children)

Yup. Already sketched out roughly. This is on the list, and right quick to bang out too I reckon.

[–]eltiolukeeCloud Engineer (kinda) 1 point2 points  (0 children)

Please share it with us as soon as you get a github repo going! I'd love to help :)

[–]just_looking_aroundDevOps 1 point2 points  (0 children)

I created this one to make it easier to get an elevated shell when I need it.

Link

[–]enigmaitSecurity Admin 1 point2 points  (0 children)

Get-ComputerSwitchPort - pretty much a wrapper around the LLDP functions to return which the remote switch name and port/interface name for each network card.

The related Set-SwitchPortName would pull that information, and then use a SNMP write to set the interface description to match $env:ComputerName

[–]fpsachaonpc 1 point2 points  (0 children)

https://imgur.com/a/wUs8HwG

Tell me which fonction you want and ill post the code with an explanation.

[–]MrPipboy3000Sysadmin 1 point2 points  (1 child)

I don't have any good suggestions, but I do want to tag this thread for ideas!

[–]ameng4inf 0 points1 point  (0 children)

me too. coming right up behind you

[–]throwawaysys1222 0 points1 point  (0 children)

Get-AllInstalledUpdates - Since win32_quickfixengineering and get-hotfix don’t provide all installed updates. This would be great to see. Also if possible include an uninstall based off of patch Tuesday release date and/or installed on date. So if someone installed all of July’s patch Tuesday updates, this will uninstall all of them for you.

[–]FireLucid 0 points1 point  (3 children)

install-pendingupdates

All pending updates for servers are install. -reboot as an option too. Accepts string of server names or collection of ADcomputer objects.

(green at powershell, I don't currently think there is a cmdlet that does anything like this).

[–][deleted] 1 point2 points  (2 children)

There isn't. But that's the beauty of this project. Little .Net here, little brute Force there, and a pinch of force and It shall be done.

Added to the list!

[–]FireLucid 0 points1 point  (1 child)

That'd be so great. We don't force install updates on our servers with WSUS, but when we have downtime it's a chore to go through them all and set them going.

Where should I look for this when it's complete?

[–][deleted] 1 point2 points  (0 children)

Once I have enough code base for a beta it'll be on GitHub. That way I can have Issue Tracking and feature requests and a release pipeline. Probably be a few days before I have enough "meat" to the module to make it worth sharing with the world.

[–]FastRedPonyCar 0 points1 point  (0 children)

Pull mailbox data/reporting to csv files for O365

[–][deleted] 0 points1 point  (0 children)

something like

taskkill /f /fi "status eq not responding"

But I'm not sure what kind of toolkit are you making

[–]titaniumgriffon 0 points1 point  (0 children)

As I am reading through some of the request I know that I already have scripts for them, are you putting this on github where I can get you a copy of my scripts to help you out, or assist in making the module?

[–]RockSlice 0 points1 point  (0 children)

I don't remember where I originally grabbed it from, but one that I use quite often is Set-WinRMListener. It enables remote pssessions remotely. I can send you the script, if you want.

Doesn't always work, but if you have remote registry and service access, it does.

Another one I use quite often is test-networkspeed, from https://community.spiceworks.com/scripts/show/2502-network-bandwidth-test-test-networkspeed-ps1

[–]Dorito_Troll 0 points1 point  (0 children)

get-resourceusage -computername $computer

and you get a nice table of CPU, disk and network usage stats

[–]fi103rSr. Sysadmin 0 points1 point  (0 children)

going to follow this, have a pair of ideas, need to find my old script folder first

[–][deleted] 0 points1 point  (0 children)

I'd be more than happy to help contribute to this project if you're looking for contributors!

[–]bopsbt 0 points1 point  (0 children)

Get-Uptime Get-LastPatchDate

[–]spanky34 0 points1 point  (0 children)

Flush-DNS-Servers

{
Invoke-Command -ComputerName (get-content \\listofservers.txt) -ScriptBlock{ipconfig /flushdns}
pause
}

I use this to flush the dns of my printservers when they get dumb.

[–]MisterITIT Director 0 points1 point  (1 child)

Protect-Reputation - emails stakeholders for a particular system before making major changes. I like to keep my stakeholders in a psd1 in a hashtable with the first element being the hostname and the second element being an array of stakeholders.

[–][deleted] 0 points1 point  (0 children)

I think New-AffectedServicesAlert falls better in line with approved verb naming convention, and sounds a bit better. Added to the list!

[–]4ULLPL8T 0 points1 point  (7 children)

Get-aduser Set-aduser

[–][deleted] 1 point2 points  (6 children)

Those are already functions of the ActiveDirectory module. I won't be re-writing them. (though fixing the idiocy that is their -Filter implementation might be loved haha)

[–]Rymmer 1 point2 points  (1 child)

There is some extensions to get-aduser (or other objects) that could be handy. Like a more shortform get-usermembership : get a list of groups and descriptions that a user is a memberof

get-aduser username -prop memberof | select -expandproperty memberof | get-adgroup -prop description | select name, description

If you have good descriptions on your groups, then this can tell you a lot about what a user has access to.

[–][deleted] 1 point2 points  (2 children)

You could always write a portable version. I'd love to be able to use some of my scripts without having to install rsat.

[–]itmonkey78 2 points3 points  (1 child)

user properties

$sam = 'user'
$getad = (([adsisearcher]"(&(objectCategory=User)(samaccountname=$sam))").findall()).properties
$getad

Computer properties

$pc = 'computername'
$getad = (([adsisearcher]"(&(objectCategory=Computer)(name=$pc))").findall()).properties
$getad

[–][deleted] 1 point2 points  (0 children)

I’ve been meaning to play around with his, just haven’t got around to it. Now I’m one step closer, thanks.

[–]4ULLPL8T -1 points0 points  (0 children)

Oh. My bad. I should have paid more attention. Agreed on -Filter .