Sunday, 25 July 2021

Storage

 

Storage by saththiyan s

MacOS 12 Monterey Public Beta on MacBook Pro MI

Install Apple iOS 15 Public Beta 2

Windows Server 2012 R2 is Stuck on "Updating Your System"

 


I had few Windows Server 2012 R2 to update. When I  was checking for updates, there were over 49 updates on one of the backup server, Most of them "Critical Update". So i had to update them and done so. Once all the updated  installed system forced me to restart. it was almost early morning 4am so i pushed the restart and went to bed. Morning since it was my backup server, non critical checked the systems and what i saw was surprising. Systems had a message " Updating your system (4%). Almost 6 hours it was at 4% and i realised its not going to work, unfortunately i didn't have any checkpoint to roll back too. 

After some google search i found an interesting step by step guide for workaround, Thank god it worked. 

Hera are the work around which worked for me. 

I have a Hyper-V environment. 


1) Turn off VM.

2) Adjust Autostart Settings (set a 5-second delay). - If not already done.

3) Power on VM in Safe Mode. Press F8 while booting the operating system. 


4) Choose "Troubleshoot" then "Command Prompt"

5) Enter the password for a local administrator account.

6) Next,  run the following command to see the list of all available drives:

     wmic logicaldisk get name


7) Next, we need to navigate to the C:\Windows\WinSxS

     cd Windows\Winsxs


8) Next, we need to list all files beginning with "Pending".

     dir pending*


9) Next, we need to rename all "Pending" files to append "_old

     ren Pending.xml Pending_old.xml


10) Next, we need to create a new blank "Pending.xml" file

     echo > pending.xml


11) Next, we need to navigate to the C:\Windows directory

    cd..


12) Next, we need to create a new directory within Windows called "scratch"

    mkdir scratch


13) Next, we need to run a DISM command to remove/revert all

   DISM /Image:C:\ /Cleanup-Image /RevertPendingActions /scratchdir:C:\Windows\Scratch


14) Next, we need to rename the "SoftwareDistribution" folder to "SoftwareDistributionOLD".

   ren C:\Windows\SoftwareDistribution C:\Windows\SoftwareDistributionOLD


15) Next, we need to run a system file checker tool 

    sfc /scannow


16) Lastly, we need to restart the VM




Wednesday, 9 June 2021

Network Drive Mapping using GPO and Bat files

Its very common practise in large organisations to map the shared folders using GPO. It can save time for the administrator to go to each computer and map them one by one. 


Lets see how we can do the mapping here.. 

You need a domain controller and a client computer connected to domain ( member) 

In my case i have created two OUs and each OUs has two users. I am going to create mapping to all the users. To do this..

1) need to have shared folders

2) Need a Bat file and save under  sysvol folder 

 C:\Windows\SYSVOL\sysvol\YOUR_DOMAIN_NAME\Script

3) need a GPO

Save the 

Step 1) sharing a folder : 

Create a new folder ,--> Right Click --> Property --> sharing on the top 2nd tab. 

Add who needs to be given permission to read and write in this folder.. remove others except Administrator. 


Step 2) Need a Bat file.

Open the Notepad and save it as .bat ( make sure no .txt is attached with the file extension) 

if you are not sure how to save as .bat file ( read here )

@echo off
net use S: \Delete
net use S: \\server\data
net use P: \\server\Print

You can add as many as shared folders with the command net use S: \\server\data,  make sure to change the drive letter and File path. 

save this file under 

 C:\Windows\SYSVOL\sysvol\YOUR_DOMAIN_NAME\Script


Go to your Group policy manager and create a new policy under the specific OU in group policy manager and edit that. 


Option 2: 


Under user configuration --> Preference --> Windows Setting --> Drive maps --> right click --> new --> mapped Drive. 

Specify the location \\servername\path.

select a Drive Letter to show when mapped. 



Thanks all you login to client PC and you should be able to see the map Drive. 

Change file extension ( .txt to .bat)

If you are wondering how to change a file extension follow these steps. 


First make sure you have the Hide file extension is deselected. 




One is deselected you can see the file extension 



Right click on the new text document.txt and rename. when you rename make sure to remove .txt and change it to .bat




Click yes. thats all the file is change to .bat extension now. 

Wednesday, 5 May 2021

Change the drive letter in the Windows 10 command prompt

  1. Open the command prompt with administrator permission ( Run as Administrator) 
  2. Type diskpart 
  3. Type List Volume to see full list with drives and partitions.


        4.    
Look at the ### column above. 
        5.    You need to use its value with the command select volume 2
        6.    Substitute the NUMBER portion with the actual partition number you would like to change



        


    7.    Type the command remove letter=D o remove the drive letter. Substitute the X portion with the appropriate letter




        8.    Not that its removed 




        9.    Should you wish to assign again use the command below  Assign letter=G



Http vs Https