To map a network printer to a user profile, here's a powerful low level command: rundll32 printui.dll,PrintUIEntry /in /n...
posts-powershell
Categories
- Free tools
- SQL Admin Toolset
- SQL Compliance Manager
- SQL Defrag Manager
- SQL Diagnostic Manager for MySQL
- SQL Diagnostic Manager for SQL Server
- SQL Diagnostic Manager Pro
- SQL Doctor
- SQL Enterprise Job Manager
- SQL Inventory Manager
- SQL Query Tuner for SQL Server
- SQL Safe Backup
- SQL Secure
- SQL Workload Analysis for SQL Server
- Uptime Infrastructure Monitor Formerly Uptime
Tags
Administration agent-based monitoring Agentless Monitoring alert responses alert thresholds alerting Alerts Amazon Aurora Amazon EC2 Amazon RDS Amazon RDS / Aurora Amazon RDS for SQL Server Amazon Redshift Amazon S3 Amazon Web Services (AWS) Analytics application monitoring Aqua Data Studio automation availability Azure Azure SQL Database azure sql managed instance Azure VM backup Backup and recovery backup and restore backup compression backup status Backup Strategy backups big data Blocking bug fixes business architecture business data objects business intelligence business process modeling business process models capacity planning change management cloud cloud database cloud database monitoring cloud infrastructure cloud migration cloud providers Cloud Readiness Cloud Services cloud storage cloud virtual machine cloud VM clusters code completion collaboration compliance compliance audit compliance audits compliance manager compliance reporting conference configuration connect to database cpu Cross Platform custom counters Custom Views customer survey customer testimonials Dark Theme dashboards data analysis Data Analytics data architect data architecture data breaches Data Collector data governance data lakes data lineage data management data model data modeler data modeling data models data privacy data protection data security data security measures data sources data visualization data warehouse database database administration database administrator database automation database backup database backups database capacity database changes database community database connection database design database developer database developers database development database diversity Database Engine Tuning Advisor database fragmentation database GUI database IDE database indexes database inventory management database locks database management database migration database monitoring database navigation database optimization database performance Database Permissions database platforms database profiling database queries database recovery database replication database restore database schema database security database support database synchronization database tools database transactions database tuning database-as-a-service databases DB Change Manager DB Optimizer DB PowerStudio DB2 DBA DBaaS DBArtisan dBase DBMS DDL Debugging defragmentation Demo diagnostic manager diagnostics dimensional modeling disaster recovery Download drills embedded database Encryption End-user Experience entity-relationship model ER/Studio ER/Studio Data Architect ER/Studio Enterprise Team Edition events execution plans free tools galera cluster GDPR Getting Started Git GitHub Google Cloud Hadoop Healthcare high availability HIPAA Hive hybrid clouds Hyper-V IDERA IDERA ACE Index Analyzer index optimization infrastructure as a service (IaaS) infrastructure monitoring installation Integrated Development Environment interbase Inventory Manager IT infrastructure Java JD Edwards JSON licensing load test load testing logical data model macOS macros managed cloud database managed cloud databases MariaDB memory memorystorage memoryusage metadata metric baselines metric thresholds Microsoft Azure Microsoft Azure SQL Database Microsoft PowerShell Microsoft SQL Server Microsoft Windows MongoDB monitoring Monitoring Tools Monyog multiple platforms MySQL news newsletter NoSQL Notifications odbc optimization Oracle PeopleSoft performance Performance Dashboards performance metrics performance monitoring performance schema performance tuning personally identifiable information physical data model Platform platform as a service (PaaS) PostgreSQL Precise Precise for Databases Precise for Oracle Precise for SQL Server Precise Management Database (PMDB) product updates Project Migration public clouds Query Analyzer query builder query monitor query optimization query performance Query Store query tool query tuning query-level waits Rapid SQL rdbms real time monitoring Real User Monitoring recovery regulations relational databases Releases Reporting Reports repository Restore reverse engineering Roadmap sample SAP Scalability Security Policy Security Practices server monitoring Server performance server-level waits Service Level Agreement SkySQL slow query SNMP snowflake source control SQL SQL Admin Toolset SQL CM SQL code SQL coding SQL Compliance Manager SQL Defrag Manager sql development SQL Diagnostic Manager SQL Diagnostic Manager for MySQL SQL Diagnostic Manager for SQL Server SQL Diagnostic Manager Pro SQL DM SQL Doctor SQL Enterprise Job Manager SQl IM SQL Inventory Manager SQL Management Suite SQL Monitoring SQL Performance SQL Quality SQL query SQL Query Tuner SQL Safe Backup SQL script SQL Secure SQL Security Suite SQL Server sql server alert SQL Server Migration SQL Server Performance SQL Server Recommendations SQL Server Security SQL statement history SQL tuning SQL Virtual Database sqlmemory sqlserver SQLyog Storage Storage Performance structured data Subversion Support tempdb tempdb data temporal data Tips and Tricks troubleshooting universal data models universal mapping unstructured data Uptime Infrastructure Monitor user experience user permissions Virtual Machine (VM) web services webinar What-if analysis WindowsPowerShellFun with Date and Time
Get-Date can extract valuable information from dates. All you need to know is the placeholder for the date part you are after. Then, repeat that...
Counting Work Days
Ever wanted to know how many days you need to work this month? Here's a clever function that lists all the weekdays you want that are in a...
Converting to Hex
Here's a simple way to convert a decimal to a hex representation, for example, if you want to display an error number in standard hexadecimal...
Sending Variables through Environment Variables
Let's assume you want to launch a new PowerShell session from an existing one. To carry over information from the initial session, you can use...
Showing MsgBox
Ever wanted to display a dialog box from PowerShell rather than spitting out console text? Then try this function: function Show-MsgBox { param (...
ASCII Table
Here’s a simple way of creating an ASCII table through type casting: 32..255 | ForEach-Object { 'Code {0} equals character {1}' -f $_, [Char]$_ }...
Pipeline Used Or Not?
Sometimes you may want to know if your function received parameters over the pipeline or direct. Here is a way to find out: function test {...
Using Background Jobs to Speed Up Things
PowerShell is single-threaded and can only do one thing at a time, but by using background jobs, you can spawn multiple PowerShell instances and...
Validate IP Addresses
You can use regular expressions and the –match operator to validate user input. Here’s a loop that keeps asking until the user enters a...
Converting UNIX Time
Surprisingly, when you read some values from the Windows Registry, they do not seem to be in a readable format: $key =...
Adding Support For –WhatIf and -Confirm
Ever wanted to support the risk mitigation parameters –WhatIf and –Confirm in your functions, too? Here’s a code template that you...
Finding Disk Controller Errors
This line will analyze your system event log for disk controller errors: PS> Get-EventLog -LogName System -InstanceId 3221487627 -ea 0 |...
Adding More Fonts to PowerShell Console
Tired of using the boring default fonts in PowerShell? There are more monospaced fonts on your system. You just need to allow the console to use...
Reading Registry Values with Powershell
In a previous tip we presented the functions New-RegKey and Set-RegistryValue to you which made creating registry keys and values very easy. Here is...
Creating Registry Values
In a previous tip we introduced the new function New-RegKey that could create one or more registry keys. Here is a function that creates registry...
Creating Registry Keys
With this new function, it is simple to create new registry keys (including missing parent keys) in all registry hives. All you need are proper...
Listing Domains in Forest
Here is a function that lists all the domains in your forest: function Get-Domain{ $Root = [ADSI]"LDAP://RootDSE" try { $oForestConfig =...
Turning On Standby-Mode
To programmatically enter standby mode, you can use native .NET code like this: function Invoke-Standby { Add-Type -AssemblyName...
Correctly Returning Exit Codes
When you launch a PowerShell script from outside PowerShell, you may want to return an exit code to the caller so that the caller knows if your...
Safely Running PowerShell Scripts
If you want to run a PowerShell script from outside PowerShell, for example from within a batch file, you probably know that you need to prepend...
Adding PowerShell Goodies to Server 2008 R2
Windows Server 2008 R2 comes with a PowerShell module called ServerManager which in turn allows you to add additional features to the server....
Recording Audio Text Files
Did you know that PowerShell can record audio messages? All you need is some text. You can then turn the text into spoken language, convert it to a...
Enter Hibernation Mode
Maybe you are running lengthy tasks at night. Sometimes you may want to place the machine into hibernation once your script is done. Here’s a...
Make PowerShell Speak!
By adding a new system type called System.Speech, you can make PowerShell speak out loudly: Add-Type -AssemblyName System.Speech $synthesizer =...
Create Group Policy Reports
Windows Server 2008 R2 comes with the GroupPolicy PowerShell module. You might have to install that feature first before you can use it – run...
Admin Privileges Enabled?
If you want to know whether your script has currently full Administrator privileges, here is an (admittedly long) one-liner that tells you:...
Locking Workstation
If you ever feel the need to lock your interactive session via PowerShell, here’s a function that can do this (and also illustrates how to use...
Logging Off
Stop-Computer and Restart-Computer can shutdown and restart a machine, but there are things they cannot do, for example logging off the current...
Check for 64-bit Environment
In PowerShell v3 (CTP2 publicly available) it is finally a snap to determine whether you are on a 64-bit machine and/or shell. PowerShell 3.0 is...