Showing posts with label microsoft. Show all posts
Showing posts with label microsoft. Show all posts

Friday, December 23, 2022

Passed AZ-204

Closing year 2022 with AZ-204! 

 One of the hardest test that I have ever done. I am now officially an Azure Developer !

Monday, April 25, 2022

Passed MS-100

Today, I passed MS-100 exam. Next is MS-101.

Monday, December 06, 2021

Sunday, June 27, 2021

Passed AZ-303

 It is official! after passing AZ-303 today, I am now a Microsoft Certified Azure Solutions Architect Expert.




Sunday, May 30, 2021

Passed AZ-304

 Today, I passed AZ-304 exam ! 

One more to go to get Azure Solution Architect Expert

http://aka.ms/AzureCerts_SolutionsArchitect

Monday, April 19, 2021

Microsoft Azure Administrator Associate

 Passed AZ-104 exam today!! 

I am now officially Microsoft Azure Administrator Associate certified!! 



Friday, June 12, 2020

Hyper-V Nested VM

To allow your VM to run Hyper-V role, you need to expose the virtualization extension to the Hyper-V host by running the following PowerShell command:

> Set-VMProcessor -VMname MyVM -ExposeVirtualizationExtensions $true

Monday, March 02, 2020

Wednesday, January 08, 2020

PowerShell and Excel

I wrote a PowerShell script to start MS Excel process and manipulate an Excel file. This PS works perfectly fine when it is executed interactively by a user account. However when using Windows task scheduler, it throws the following errors:

Microsoft Excel cannot access the file
There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.

In turns out, I need to create a directory named: Desktop
In the following locations:

64-Bit OS
C:\Windows\SysWOW64\config\systemprofile\Desktop

32-Bit OS
C:\Windows\System32\config\systemprofile\Desktop

Thursday, July 18, 2019

Fix Corrupted Windows 10 File(s)

Recently, I had issue with my VM which runs Windows 10 for my daily ops work. The issue was, the hosting machine kept crashing due to unknown issue, thus ungracefully shutting down my Windows 10 VM.

One time, second time, third time were fine. Finally, one day, I wasn't able to open any ZIP file. It looked like the OS lost its association with the file type .ZIP. I went to the default file type program and could not find .zip file type. I then checked my other healthy Windows 10 machine and clearly there is no .zip file type association either.

To fix this I ran:

> sfc /scannow

When the scan was completed, I checked the log file, it had:

Could not reproject corrupted file \??\C:\WINDOWS\System32\\zipfldr.dll; source file in store is also corrupted

What I did next:

> DISM.exe /Online /Cleanup-image /Restorehealth

Then

> sfc /scannow

and I can open ZIP files again!! :)

Friday, September 21, 2018

Cleaning Up CSC Folders

C:\Windows\CSC folder is the offline files folder. It has special permissions. Without the correct permission, you won't be able to delete anything in it

To delete the content of C:\Windows\CSC, you need to modify its permissions

> cd c:\Windows
> takeown /f CSC /r /a /d y
> icacls CSC /grant Administrators:F

Then you can navigate to the folder and start deleting files

Wednesday, February 14, 2018

Windows 2016 Core Domain Controllers

Upgrading my Domain Controllers from 2012 R2 to 2016. I have decided to run the servers without Desktop Experience to save resources.

Once installed, run the "sconfig" utility from the CMD to setup the server name, IP address, DNS and gateway, then reboot

To add AD Domain Services feature:

Add-WindowsFeature AD-Domain-Services

To install AD Forest::

Install-ADDSForest -CreateDnsDelegation:$false
-DatabasePath C:\Windows\NTDS
-DomainMode WinThreshold
-DomainName domain.tld
-DomainNetbiosName NETBIOSDOMAIN
-ForestMode WinThreshold
-InstallDns:$true
-LogPath C:\Windows\NTDS
-NoRebootOnCompletion:$true
-SysvolPath C:\Windows\SYSVOL
-Force:$true

ForestMode = WinThreshold = for Windows 2016

To add AD Domain Controller to the existing domain:

Install-ADDSDomainController -CreateDnsDelegation:$false 
-DatabasePath C:\Windows\NTDS
-DomainName domain.tld
-InstallDns:$true 
-LogPath C:\Windows\NTDS
-NoGlobalCatalog:$false 
-SysvolPath C:\Windows\SYSVOL
-NoRebootOnCompletion:$true 
-Force:$true
-Credential (Get-Credential)

Thursday, December 01, 2016

Proxy Enforcer

I developed this little utility while doing proxy migration project. This utility helps me to enforce the Windows proxy settings to IE.


You can add Proxy by clicking the "Add Proxy" button, which gives you the same configuration like Windows


Once your proxy setting is added to the list, highlight the proxy and click "Select Proxy" to enforce the selected proxy to your IE. The program will run on the TaskBar. 



Wednesday, October 26, 2016

Windows 2012 R2 - File Backup

I need to backup my files running on Windows 2012 R2 to external drive. I also need this to be done in a regular basis and send me an email after the job done with the report.

First, I create a batch file, called backup.bat, with the content

@echo off
robocopy H:\Home V:\Home /MIR /R:1 /W:1 /LOG:V:\Home.txt
robocopy K:\Documents V:\Documents /MIR /R:1 /W:1 /LOG:V:\Documents.txt
copy /b V:\Documents.txt +V:\Home.txt V:\Backup.txt

The last line is joining the 2 log files into a single file, backup.txt

Schedule this daily with the Windows Scheduler, having an actions:

Start a Program: cmd.exe
Add arguments: /c D:\scripts\backup.bat

That bit is done for backup job.

Now, the email bit. I create a powershell script, called email.ps1, with the content:

 function sendMail{

     Write-Host "Sending Email"

     #SMTP server name
     $smtpServer = "smtprelay.domain.local"

     #Creating a Mail object
     $msg = new-object Net.Mail.MailMessage

     #Creating SMTP server object
     $smtp = new-object Net.Mail.SmtpClient($smtpServer)

     #Email structure 
     $msg.From = "backup@mydomain.id.au"
     $msg.ReplyTo = "backup@mydomain.id.au"
     $msg.To.Add("me@mydomain.id.au")
     $msg.subject = "Backup Email - Daily"
     $msg.body = "Backup Email - Daily"
     $attachment = New-Object System.Net.Mail.Attachment("V:\Backup.txt", 'text/plain')
     $msg.Attachments.Add($attachment)

     #Sending email 
     $smtp.Send($msg)
  
}

#Calling function

sendMail 

The email powershell script attach the backup.txt file and send it away
On the same schedule job created earlier, add a second action:

Start a Program: powershell
Add arguments: D:\scripts\email.ps1

Done. Second action will be executed after the 1st action is running and it will grab the log and attach it to the email.

Wednesday, March 16, 2016

.NET Executing Assembly Location

During coding, if you want to reference another file, such as configuration file, text file or XML file that is located on the same location where your binary/library is you can use the following:''

string location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

Have fun coding :)

Thursday, July 30, 2015

Hello Windows 10!

Today, I installed Windows 10 Enterprise x64 Edition, and it looks great!!







Look at that, how slick does it look? I like it! 
More to come on this blog about Windows 10.. stay tune.

Saturday, June 27, 2015

SCCM 2007 R2 Software Updates Diagram

My SCCM 2007 R2 Software Update relationship diagram.


Search Folder
This contains all the updates metadata that meets the criteria, e.g. superseded: no, expired:no, etc

Update List
This is the list of updates that are selected from search folder. I use this update list per month basis, e.g. Jan 2015, Feb 2015. This way, a compliance report can be run agains a specific update list. 

Deployment Packages
This is the deployment package that gets deploy to the Distribution Point. I use the same deployment package for a specific product, for example I have "Windows Server 2012 R2" deployment package for all updates of Windows Server 2012 R2, respectively of their month.

Deployment Management
This is the deployment task that is created for a specific collection.

Collections
A collection of computers that is targeted for software updates

What to do every month to patch machines?
  • Go to the search folder, select all the updates for this month for a specific product 
  • Right click and select Download Software Updates, target the deployment packages for that product. Don't forget to update Distribution Point
  • Right click and select Update List, create a new Update list for this month.
  • From the newly created Update List, select all the updates and click-and-drag them to the Deployment Task for a specific collection that you want to install the updates on
  • Check the software available and installation deadline for that Deployment task