Michael Wu

The Life of a Cloud Engineer

  • Home
  • Resume
  • Blog
  • Contact

Archives for June 2016

How to update the Home Directory in User profile by PowerShell

Posted on 06.27.16

Some users complained about their drive is not mapping on the computer. After some researches, we found the path was blank on their Home folder in the profile. So, I created a PowerShell script to fix it massively. I use the "if loop" to check if the home directory path is blank. If it is { Read More }

PowerShell: speed up Get-ChildItem to scan files in a large file system

Posted on 06.20.16

I wrote a PowerShell script for scanning PST files in the file system. The part of script likes the below code. However, it takes very long time to complete the scan. It took about 19-21 hours to scan PST files in the 28 TB file system. I found the key point to slow down the scan is the line { Read More }

Add data into SQL database by PowerShell Script – ExecuteNonQuery with 0 arguments: Incorrect syntax near ‘S’

Posted on 06.16.16

I have a PowerShell script for PST scan in the file system. The result is in a PSObject. When I added the result into SQL database, it threw an error. After debugging, I found that the error "ExecuteNonQuery with 0 arguments: Incorrect syntax near 'S'" was from a directory path. Here is the part { Read More }

Select random objects from a list by PowerShell

Posted on 06.13.16

I run a giveaway campaign recently. After the campaign end, I will have to select a winner. In the beginning, I was thinking that open a book on the random page to select a winner. However, it is not professional, and it cannot be recorded. So, I decide to write a PowerShell script for it. I am { Read More }

Recent Posts

  • Automating Resource Restriction in Azure subscriptions with Budget Alert, Automation Account, and Azure Policy
  • How to configure the Security Center via Azure Resource Manager (ARM) template
  • How to restrict Account Operators to see the password in LAPS
  • How to join a VM to a domain by PowerShell in Azure
  • How to push an existing repository from VS Code to Azure DevOps by PowerShell

Search

Categories

  • Azure
  • IIS
  • PowerShell
  • SCCM
  • VMware
  • Windows Server

Contact

Email: [email protected] | Powered By the 太初網路

Copyright © 2024 mikewu.org Disclaimer

Connect

FacebookTwitterGoogle +Linkedin