IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Change the Time Stamp of a File Using PowerShell

From time to time, you may need to modify the time stamp of a file for archiving or any other reasons.

This PowerShell script comes in handy when you need to do it. This is for a one-off tweak of a file. If you’re doing this in bulk, it’s probably better to use Robocopy with a /copy:T option (see an example here) to copy all the attributes including the time stamp.

PowerShell script to change the timestamp for a file

(Get-Item "C:\Temp\ITNota.txt").LastWriteTime=("6/1/2022 15:00:00")

Or

(Get-Item "C:\Temp\ITNota.txt").LastWriteTime=("1 June 2022 15:00:00")

Two versions of the script were provided to eliminate ambiguity of the date system. You just need to use one of them.

If you use the US date format, the first one will work. Otherwise, it’s always safer to spell out the date and the month.

Further Reading

How to Change File Date or Timestamp in Windows

July 20, 2022 Filed Under: How To Tagged With: PowerShell, Windows, Windows Server

How to Backup IIS Manager Connections List on Windows

You’ve been using IIS Manager to manage remote IIS from your local computer. But how do you export the connections list if you move to a new computer or just to back it up if you lost all data?

IIS Manager Connect Remote Server

This post will show you how you can export and back up IIS Manager connections list on your local PC.

All connections in IIS Manager are saved in a binary file called InetMgr.preferences and it can be found in the following folder:

%APPDATA%\Microsoft\WebManagement\7.0.0.0

Or

C:\Users\{NTID}\AppData\Roaming\Microsoft\WebManagement\7.0.0.0

*Replace the {NTID} with the user id you use to logon to your computer.

IIS Manager preferences file

This is the file you want to backup so copy this file to your backup folder. When you need to restore it, just copy this file back to the above folder and you should be back in business.

Important: Do not try to restore the file when IIS Manager is open. When you quit the application, it will write the last settings on that InetMgr.preferences file.

Further Reading

How to Manage IIS Servers Remotely

March 6, 2019 Filed Under: How To Tagged With: IIS, Internet Information Services, Microsoft, Windows, Windows 10

How to Check Installed .NET Core Version

This is one way to determine what version of .NET Core is installed on your machine (or if it’s not installed):

  1. Launch Windows PowerShell.
  2. Runtime
    (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'shared\Microsoft.NETCore.App')).Name
    
  3. SDK
    (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name
    

In the following example, you can see that .NET Core 2.1.2 Runtime is installed, but the SDK is not installed with the following error message:

dir : Cannot find path 'C:\Program Files\dotnet\sdk' because it does not exist.
At line:1 char:2
+ (dir (Get-Command dotnet).Path.Replace('dotnet.exe', 'sdk')).Name
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program Files\dotnet\sdk:String) [Get-ChildItem], ItemNotFoundExcept
   ion
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
 
PS C:\Windows\system32>

PowerShell query for installed .NET Core version

Otherwise, it will look more like the next screenshot:

PowerShell query for installed .NET Core version for both Runtime and SDK

Another Way

There’s another way to accomplish the same thing with a much simpler command and this works on either Windows or macOS.

  1. Depending on your operating system, launch either Windows PowerShell or Terminal.
  2. Runtime
    dotnet --list-runtimes
    
  3. SDK
    dotnet --list-sdks
    
Installed .NET Core versions for both Runtime and SDK from PowerShell

Windows PowerShell

 

Installed .NET Core versions for both Runtime and SDK from macOS Terminal

macOS Terminal

 

When you see more than one entries, that means you have several versions installed and actually that’s the advantage of using .NET Core, you can have different versions installed side-by-side. The latest version is the last version number at the bottom of the result.

If you need a way to check the installed version of .NET Framework instead, check the link here.

Further Reading

How to Check Installed .NET Framework Version
How to determine if .NET Core is installed
How to: Determine which .NET Framework versions are installed
How to: Determine which .NET Framework security updates and hotfixes are installed
How to Remove .NET Runtime and SDK on Mac
How to Use System.Configuration.ConfigurationManager on .NET CORE

January 30, 2019 Filed Under: How To Tagged With: .NET, .NET Core, Microsoft, PowerShell, Windows

How to Create Key Pair Using Kleopatra (GnuPG)

If you need to find a free solution to encrypt file or email, Gpg4win (GNU Privacy Guard for Windows) may be more than enough encryption than what you need. It is a free software and pretty straightforward to install. Before you can use it though, you need to create a key pair first and this may be confusing to beginners. Here are the steps to generate a key pair in GPG4Win Kleopatra:

  1. Launch Kleopatra and click on New Key Pair.

    Kleopatra creating new key pair

  2. Type in your name and email. Although it’s optional it’s important that you fill that in as your email will be used as the identity to verify your signature.

    Click on the Advanced Settings….

    Kleopatra key pair creation wizard

  3. Select ECDSA/EdDSA. For starters you can leave the defaults, then click OK.

  4. There’s a whole range of debates between using RSA vs ECDSA and you can check some of the included links at the bottom of this post. The short version is, use ECDSA when you can, use RSA if you have concern with compatibility.

    Kleopatra key pair creation advanced settings

  5. Click on the Next button, then click-on Create.

    Kleopatra key pair creation review parameters

  6. On the next windows, you’ll be asked to type in a passphrase. Don’t leave this blank. Use a good passphrase by checking the quality bar as your guide. Then click OK.

    Kleopatra set passphrase for key pair creation

  7. When a key pair successfully created, you will see the following window with your Fingerprint. Make sure you Make a Backup Of Your Key Pair before clicking Finish.

    Kleopatra key pair successfully created

Once this process completed, you can export your public key and give it to anyone who needs to send you an encrypted message or file and you’re ready to communicate securely.

Download

Gpg4win

Further Reading

ECDSA: The digital signature algorithm of a better internet
SSH key-type, RSA, DSA, ECDSA. Which to choose?

October 1, 2018 Filed Under: How To Tagged With: Information Security, Internet, Windows

How to Install IIS on Windows 10

Although IIS is included in every installation of Windows 10, it’s not turned on by default. Here’s a way to install IIS on Windows 10.

  1. Right-click on the Windows button on the bottom-left corner and select Run

    Windows Run

  2. In the Run dialog box, type appwiz.cpl and press ENTER.

    Windows run appwiz.cpl

  3. As soon as a new window called Programs and Features is opened, click on the link Turn Windows features on or off.

    Windows Programs and Features

  4. Click on the Internet Information Services checkbox. By default it will install all you need to host a website. However you might want to check some other components that you might need as well. Once done, click OK and Close when it says “Windows completed the requested changes.”

    IIS Windows Features

  5. Now open your browser and type in localhost and press ENTER. You should see a default web page is rendered in your browser.

    IIS Default Page

That’s all there is to it and the default website directory will be in C:\Inetpub\wwwroot folder.

Further Reading

How to Manage IIS Remotely
How to Manage IIS Servers Remotely with WMSVC
How to Backup IIS Manager Connections List on Windows
How to Install IIS Management Console on Windows
How to Migrate IIS Websites to a Different Server
New Features Introduced in IIS 10.0
How to Setup HTTP Strict Transport Security (HSTS) on IIS
How to Activate Built-in Web Server

May 31, 2018 Filed Under: How To Tagged With: IIS, Internet Information Services, Microsoft, Windows

« Previous Page
Next Page »
Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure