IT Questions and Answers :)

Wednesday, December 9, 2020

In Windows PowerShell, which of the following is a way you can load WPF for the creation of GUI interfaces in your scripts?

In Windows PowerShell, which of the following is a way you can load WPF for the creation of GUI interfaces in your scripts?

  • [reflection.assembly]::loadwithpartialname("System.Windows.Forms")
  • Add-Assembly -AssemblyName System.Windows.Forms
  • New-Object -TypeName System.Reflection.Assembly(System.Windows.Forms)
  • New-Assembly -AssemblyName "WPF" 

In Windows PowerShell, which of the following is a way you can load WPF for the creation of GUI interfaces in your scripts?

 EXPLANATION

You would call the System.Reflection.Assembly object, then load the WPF assembly, "System.Windows.Forms" with the method LoadWithPartialName. This allows you to then add objects from the System.Windows.Forms assembly, like Form or Button.

SOURCE

https://msdn.microsoft.com/en-us/library/system.reflection.assembly.loadwithpartialname(v=vs.110).aspx

 

Share:

Tuesday, December 8, 2020

What is the codenamed for the Microsoft Hyper-V?

What is the codenamed for the Microsoft Hyper-V?

  • Viridian
  • Vendana
  • Victory
  • Vicious 

What is the codenamed for the Microsoft Hyper-V?

 

EXPLANATION

Microsoft Hyper-V, codenamed Viridian and formerly known as Windows Server Virtualization, is a native hypervisor; it can create virtual machines on x86-64 systems running Windows. Starting with Windows 8, Hyper-V supersedes Windows Virtual PC as the hardware virtualization component of the client editions of Windows NT. A server computer running Hyper-V can be configured to expose individual virtual machines to one or more networks.

Hyper-V was first released alongside Windows Server 2008, and has been available without charge for all the Windows Server and some client operating systems since.

Hyper-V is also available on the Xbox One, in which it would launch both Xbox OS and Windows 10.

SOURCE

https://en.wikipedia.org/wiki/Hyper-V
Share:

Monday, December 7, 2020

What do you do when you receive this error on a client machine "The trust relationship between this workstation and the primary domain failed"

What do you do when you receive this error on a client machine "The trust relationship between this workstation and the primary domain failed"

  • Unplug the ethernet cable, power off and on, plug the ethernet cable back in and log in.
  • Reboot the machine in "Safe Mode" and change the Administrator Password
  • Log in as local Admin and rejoin the machine to the Domain
  • Reboot the machine and keep hitting the F7 key until the machine connects with the Domain. 

 

What do you do when you receive this error on a client machine "The trust relationship between this workstation and the primary domain failed"

EXPLANATION

When you try to access a computer running Windows that is a member of your domain and it fails... it will show this message:

"The trust relationship between this workstation and the primary domain failed"
The reason;

The computer's machine account has the incorrect role or its password has become mismatched with that of the domain database.

Trust relationship issue Microsoft

SOURCE

http://www.tomshardware.com/forum/28973-63-trust-relationship-workstation-primary-domain-failed
Share:

Thursday, December 3, 2020

What is the keyboard shortcut for locking a PC on Windows XP or later?

What is the keyboard shortcut for locking a PC on Windows XP or later?

  • Win + L
  • Ctrl + Alt + Del
  • Win + S
  • Win + D 

 
What is the keyboard shortcut for locking a PC on Windows XP or later?

EXPLANATION

Windows is chock full of helpful and fast keyboard shortcuts. One area that many end users struggle with is properly securing their workstations when away from their desk. IT Professionals often overcome this through AFK timeouts in group policy, however it is always helpful to educate your users on ways to help them help themselves. Most users are familiar with using their mouse to navigate their start menu to the "Lock" option, and some more experienced users might still be using "Ctrl + Alt + Del," followed by either the spacebar, or a click of the "Lock" option, however "Win + L" is a quick and easy solution that most can remember when you remind them that they are "Locking" their "Windows" with a "Key." 

https://en.wikipedia.org/wiki/Windows_key#Windows_XP

 

Share:

Monday, November 30, 2020

In PowerShell, which of the following expressions round a floating point number contained in the variable $Num to 2 decimal places?

In PowerShell, which of the following expressions round a floating point number contained in the variable $Num to 2 decimal places?

  • Get-RoundNumber -Number $Num -Precision 2
  • $Num -round 2
  • $Num.Round(2)
  • [Math]::Round($Num, 2) 
 
In PowerShell, which of the following expressions round a floating point number contained in the variable $Num to 2 decimal places?

EXPLANATION

As of PowerShell version 5, there is no native PowerShell cmdlet to round numbers; additionally, floating point types do not contain a method to accomplish this.  The best way to round a number to a certain precision is to utilize the .NET framework's System.Math class, which contains the static method Round().

Technically, Math.Round() only accepts numbers of the type double or decimal, but passing it a float (also known as a single) will automatically convert that number to a double for this purpose.

The above example and solution uses the following definition of Round():

static double Round(double value, int digits)

Additional documentation on the System.Math.Round() method:https://msdn.microsoft.com/en-us/library/system.math.round(v=vs.110).aspx
 
 
Share:

Popular Posts