Skip to main content

Posts

Showing posts with the label Elevated CMD

Check TLS settings in IE properties

 IE Properties or Internet Explorer properties still plays a part on Windows 10 or even Window 11. For example, some VPN settings like TLS or Transport Layer Security still checks on IE Properties. How to access Internet Explorer or IE properties? If IE is not yet blocked on the corporate environment or active directory network, then press windows key + r and type, iexplore on the run box. This will open Internet Explorer. A better way to do this without opening IE itself, is to use the Control Panel applet. Press windows key + r to open run box. And on the run box windows type, inetcpl.cpl and click ok or pres enter to run the command. This will open the IE or Internet Explorer properties and changes can be made. The other way is to check the Windows Registry, but a word of caution don't play or change the registry if you're not sure of what you're doing as this might lead to corrupting your Windows OS. Anyway, if you want to try or experiment on a Windows VM that can be ...

How to burn iso to CD or DVD in using Windows command line

Burning ISO is quite common especially if you need a bootable disc to install a software to a laptop, desktop or a server. So, how to burn an ISO image in Windows without a 3rd party software? The answer is yes it is possible. In a Window 10 or Windows 11, laptop or device a USB DVD/CD burner is needed. Of course, a blank DVD or CD is needed as well. How to burn an ISO image in a Windows command line? Open a windows command prompt, press Windows Key + R this will open run box and type "cmd" and press enter. Or simply, search for CMD on Windows menu and click on it. On Windows command prompt type: cd c:\windows\syswow64 on a 64 bit architecture machine. on c:\windows\syswow64 type the full path where the ISO can be found. Example: c:\windows\syswow64\isoburn  VMware-VMvisor-Installer-7.0U3g-20328353.x86_64.iso  So, the syntax is: isoburn path-to-the-iso-file  the burner will be automatically detected by the CLI. Sample image below of the ISOBurn. Once the ISO burn opens, t...

Set or create a task scheduler using PowerShell or via command prompt

Task Scheduler in Windows or Cron in Linux is a life saver on the Sys Admin world. Why it is a life saver? You can set a scheduled task and forget about it. Of course, provided you have already carefully examined and test multiple times what will be the output when the Task is triggered. Yes, set and forget; once you are confident enough that everything will go smoothly. If there are task that needs to be run at midnight or early hours in the morning, Task Scheduler will come in handy. So, how do we set a Task Scheduler using PowerShell or Command Prompt? Why need to learn both? And not just PowerShell? Well, command prompt is always available on all Windows distribution. While PowerShell might be available on newer Windows system but then some restriction might be in place for security reasons. Therefore, it is good to be familiar with both PowerShell and Command Prompt executable files. PowerShell code snippet below shows how to set or create a Task Scheduler. PowerSh...

How to use hibernate in windows from command line?

Hibernate option in Windows is an option to shutdown any Windows laptop and after turning on again the laptop, all resources that was open before shutting down; such as word document, excel or other application are still available and running. The user doesn't need to re-open the applications. User  can continue where he or she has left off. Cool, feature! Using command line, the cli command shutdown.exe provides an option on how to shutdown a Windows machine to hibernate. The option I believe is available for all Windows edition even Server edition. Why do we need to use hibernate in Windows? Well, there are plenty of reasons. One example, if you have a few browser tabs open but then you need to shutdown the machine and don’t want to re-open all the browser tabs then hibernate is a good option. Or if you’re downloading something and you need to check whether download was completed, or just need to check whether there were some errors during the download operations then hibern...

Enable/Disable NICs from Windows command line

First thing to do is to get or list all NICs available on the system. This must be done by opening or running the command in an elevated command prompt. Check out links below on how to open an Elevated Command Prompt. https://quickbytesstuff.blogspot.com/2014/10/open-elevated-command-prompt.html https://quickbytesstuff.blogspot.com/2018/06/how-to-open-elevated-command-prompt.html Why need to open an elevated CMD? Some commands needs to be run by a person who understands what he or she is doing. Or simply, some commands are for Sys Admin or IT personnel who are tasked to control or manage the system. So, commands has to be run on a elevated cmd which has an admin privileges. Here's how to enable or disable NIC interfaces on a Windows system via CLI. First, open an Elevated CMD. Then need to list, show or get all the available NIC on the system. Get NIC list and index number: wmic nic get name, index Sample Output of the above command: C:\WINDOWS\system32...

What application is running behind svchost.exe in Windows?

Task Manager can be opened in different ways via Taskbar, pressing Ctrl + Shift + Esc or right clicking on the Windows icon and selecting Task Manager. In Task Manager window, it will show what are the processes or services running on the system. On the Details Tab of the Task Manager the details of the .exe file or the applications or services running on the system will be displayed. One noticeable thing on Task Manager is the svchost.exe, depending on how busy the system is or how many applications, browsers or other items that will need to connect to svchost.exe. The said exe file can easily be seen on Task Manager since there will be few of them.   But what is the application running behind the svchost.exe? Or what is occupying or using svchost.exe? Why there are a few of them running on the system? To get to the bottom of all the questions above, PID or Process ID will show what is behind the svchost.exe. To do this, open an elevated CMD or command prompt window....

Office 365 Admin PowerShell basic commands

 Managing Office 365 via PowerShell CLI needs to have proper access rights or privileges.   First step is to connect to the Office 365 domain via an elevated PowerShell terminal. Connect-exchangeonline -userprincipalname email-admin@domain.com PowerShell for Office 365 is very handy. Below are just a few examples that might save some time and focus on other important task, or just simply enjoying more coffee time. Get or list aliases of a mailbox, email account or group mailboxes. Get-UnifiedGroup -Identity "Name of the Mailbox" | Select-Object DisplayName,@{Name=”EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_ -LIKE “SMTP:*”}}} | ft -wrap List the Primary Email of a group's mailbox using the group name. Get-UnifiedGroup -Identity "Name of the Mailbox"   | Select-Object DisplayName,PrimarySmtpAddress Change group primary email. Set-Unifiedgroup -identity "Group Name to change email" -primarysmtpaddress new-email@of-the...

Windows release DHCP IP Address and get a new one

 Working remotely is quite a norm in today's pandemic world.  IT / System Admin working remotely may find it difficult or a good opportunity to work at the comfort at their own homes. Difficult in a way, when something goes wrong on a server or any device and you need a physical hand even just to force power off and turn it back on may seem an impossible task. DHCP is an amazing technology that lets machines auto configured themselves with an IP Address without human intervention. But not everything seems to work smoothly at times, and if you have multiple networks in a single manage switch. Changing one network from another makes life easier using a manage switch. However, the machine, server or computer may not change easily; you either need to reboot the machine or just simply release and renew the DHCP to set or get the desired IP Address from a new network profile. In Windows DHCP network, ipconfig /release will release the IP and the machine will be automat...

PowerShell read text file at a specific or certain lines

Reading log files or text file is quite basic and log files should be reviewed or else recording the logs if of no point. PowerShell code below read the 2 nd line of a specific text file specified on the path.   $logs = get-content c:\dev\log1.txt   "Line number 2 in log1.txt is: {0}" -f ( $logs [ 2 ] )     PowerShell code below uses a loop to read number of lines on a specific text file. $logs = get-content c:\dev\log1.txt   ForEach ( $line_number in 0 .. 10 ) {   "Line number $line_number is : {0}" -f ( $logs [ $line_number ] )}     Using above code, 0 is equal to line 1.   So, to read the first line code should be like this:     $logs = get-content c:\dev\log1.txt   "Line number 1 in log1.txt is: {0}" -f ( $logs [ 0 ] )     To read the last line: $logs = get-content c:\dev\xtest.txt -Tail 1 $logs     If above command will return an emp...

Use PowerShell in Excel VBA

VBA in Excel is very helpful since it can run things without any human intervention, or technically it can run task and automate things and just get the result. VBA coupled with PowerShell can even be more interesting. Of course, there is always some drawback or pros and cons. Bad actor can take advantage of VBA and PowerShell to run malicious software on user’s computer. For most users who are not aware or doesn’t believe that VBA and PowerShell can be used to steal data, one common reaction is; Is it possible? Or you are just trying to exaggerate and scare people? As the odds say, to see is to believe. Or to see it in action is one thing and trying to educate users is another thing. Cyber Security is a task that everyone should be a part of, a chain is useless if one its link is weak. Which is basically, true in digital world. The company may spend thousands of moneys on Firewall, Anti-Virus and other devices or software to thwart attack but just a simple click on a Phishin...