Browsed by
Category: QuickTips

QuickTip – PowerShell – Run External Commands with Variables

QuickTip – PowerShell – Run External Commands with Variables

If you want to be able to run commands for an external application in a PowerShell script with defined variables, you can use the following method. In my case, I wanted to trigger some PDQ Deploy packages to install on a certain computer (as part of larger initial deployment script), where the computer name is set using a variable. Here is an example of three lines that will allow you to run PDQDeploy.exe with its own parameters, mixed with a…

Read More Read More

QuickTip – RoboCopy – Command to Move Files Older Than Certain Number of Days, with Directory Structure

QuickTip – RoboCopy – Command to Move Files Older Than Certain Number of Days, with Directory Structure

Let’s say that you have a design department share that is filling up your datastore of one of your on-premises ESXi servers hosting some Windows file servers. Your budget to upgrade your host servers has been delayed and, thanks to Covid-19, now, even further out. You need to keep this datastore from filling up but don’t want to force the end users to deal with changes on their Macs but still allow the data to be accessible. The design manager…

Read More Read More

QuickTip – PowerShell – Scripts to Remotely Rename an Active Directory Computer Object

QuickTip – PowerShell – Scripts to Remotely Rename an Active Directory Computer Object

If you are deploying new systems or otherwise need to rename an AD computer object, you can use this script to make the change- Rename-Computer -ComputerName CURRENNTName -NewName NEWName –DomainCredential ADDomain\admin Make the changes, inline, to modify the current and new name parameters. As well as, change the “ADDomain\admin” to the AD domain and account that has the necessary permissions to change the name of the computer object. If you would like to make the script more interactive, you can…

Read More Read More

QuickTip – PowerShell – Script to Reset AD User’s Password

QuickTip – PowerShell – Script to Reset AD User’s Password

If you manage systems and services that allow users access with a their Active Directory username and password, you have probably dealt with password reset issues. Sometimes, you are setting up new systems or services with a test account. Here is an easy PowerShell “script” to reset an AD user’s password. $sAMAccountName = Read-Host -Prompt “sAMAccountName” $SecurePW = Read-Host -Prompt “Enter a Password” -AsSecureString Set-ADAccountPassword -Identity $sAMAccountName -Reset -NewPassword $SecurePW The first line prompts you to enter the sAMAccount name…

Read More Read More

QuickTip – Extreme Networks Summit Switch Stacks – View Last Power-On Time for All Slots (ExtremeXOS CLI)

QuickTip – Extreme Networks Summit Switch Stacks – View Last Power-On Time for All Slots (ExtremeXOS CLI)

For some reason, ExtremeXOS doesn’t have a simple command to display the boot time or uptime for switches comprising a stack. However, one of their support techs, posted a command in their support forums that gives you the power-on date and time. To view it for all stack members, run the following command after connecting to the ExtremeXOS console on the stack’s master switch- debug hal show platform cardInfo | i “Slot:|PowerOn” You’ll be presented with the “PowerOnDate” for each…

Read More Read More

QuickTip – One-Time Scheduled CentOS (and Other Linux Distros) Server Reboot

QuickTip – One-Time Scheduled CentOS (and Other Linux Distros) Server Reboot

Let’s say that you ran some updates on your CentOS server but can’t reboot it until a later time, like when users have gone home for the day. Run this simple command to schedule the server to reboot at a certain time. In this case, 8 PM. sudo shutdown -r 20:00 As indicated in the confirmation received after running the command, you can use this command to override and cancel the scheduled reboot, you can run this command- sudo shutdown…

Read More Read More

QuickTip – Need to Check the Active Connections to Your Squid Proxy Server?

QuickTip – Need to Check the Active Connections to Your Squid Proxy Server?

If you want to update and reboot your Squid proxy server, you might want to check to see if there are active connections. Run this netstat command with grep to check all the active connections on your squid proxy port. netstat -na | grep :3128 If you only see this result, no one is currently connected- When at least one device is connected, you will see something like this-

QuickTip – Need to Clear DNS Cache on a Remote System?

QuickTip – Need to Clear DNS Cache on a Remote System?

I have been using PDQ Deploy in central server mode and have had an occasional issue when deploying new systems, where the name and/or IP address is changed (say from a wired to wireless network) and the PDQ deploy server still has the DNS name and IP cached. Obviously, running – IPConfig /flushdns will only clear the cache on your local system. But, the problem is that the PDQ Deploy server needs to have its DNS cache cleared. Run this…

Read More Read More

QuickTip: Azure Active Directory Connect – Re-enable Automatic Sync Schedule

QuickTip: Azure Active Directory Connect – Re-enable Automatic Sync Schedule

Sometimes performing an upgrade of Azure Active Directory Connect (AADC) will disable the automatic synchronization schedule. Don’t get caught off guard! Running the following in PowerShell can save you some grief. To verify the existing sync settings, use this cmdlet- Get-ADSyncScheduler Note that SyncCycleEnabled is showing as False. 2. To enable the sync cycle schedule, use this cmdlet- Set-ADSyncScheduler -SyncCycleEnabled $true 3. Verify that your settings have taken effect by running the original cmdlet- Get-ADSyncScheduler Now the SyncCycleEnabled setting shows…

Read More Read More

QuickTip: Microsoft Desktop OS Licensing Rule of Thumb

QuickTip: Microsoft Desktop OS Licensing Rule of Thumb

From the convoluted world of Microsoft licensing: If you want to “reassign” Windows desktop operating system volume licenses to other devices, you must have an OEM license with pro or better on the new (and old) device AND have active SA (Software Assurance). What do I mean? Volume licenses without Software Assurance behave like OEM licenses in regards to which device they are assigned/licensed. Both are only good for the device that they were initially installed on. If that device…

Read More Read More