Sunday, January 24, 2021

Unexplicable powershell errors when installing a module or running a script

 TLS incompatibility

run below as admin first..after ...executionpolicy unrestricted..

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Thursday, February 20, 2020

iDRAC issues with Java and Remote console not launching

Go to Java installation folder.
Open {JRE_HOME}\lib\security\java.security -file in text editor.
Delete or comment out the following line "jdk.tls.disabledAlgorithms=SSLv3".

source: https://www.dell.com/community/Systems-Management-General/iDRAC6-Virtual-Console-Connection-Failed/m-p/6088796/highlight/true#M26061

Sunday, September 15, 2019

Unable to delete file due to long filename

When you want to completely delete a directory and it contains long paths, robocopy does a VERY good job:
mkdir empty_dir
robocopy empty_dir the_dir_to_delete /mir
rmdir empty_dir
rmdir the_dir_to_delete

Monday, May 27, 2019

AzureRM AZ login and AzureRMaccount in DOS command prompt and Powershell

For Powershell

Use this command to upgrade to PS v5.3 to use Connect-AzureRMaccount OR Login_AzureRMaccount, do the following in an admin powershell window:

Set-ExecutionPolicy RemoteSigned

Install-Module -Name AzureRM -RequiredVersion 5.3.0

Install-Module Azure # -Force -AllowClobber
Import-Module Azure # -Force # AzureRM 
Install-module AzureRM # -Force -AllowClobber
Import-Module AzureRM # -Force
Import-Module AzureRM.Compute # –Force


For DOS

Download and install .msi to use AZ Login

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?view=azure-cli-latest

Monday, May 20, 2019

Renewing / Installing an SSL certificate on a Remote Desktop Web server (RD Web, RD App)

Source: https://social.technet.microsoft.com/Forums/windowsserver/en-US/0672ce12-dea9-40f6-8e54-3e0bf69b1c41/server-2008-r2-rds-gateway-certificate-renewal-replaced-certificate-not-being-picked-up

According to your post, this issue occurs on the program of RemoteApp when you try to access. If I misunderstand it, please correct me.

As far as I know, when you access the program of RemoteApp, the process is the following:

RD web Access->RD session host->RemoteApp Manager

In this case, I think your certificate is misconfigure on the RD session host server. By default, the system will use the “Auto generated” certificate which is created by local server. I’d like to perform the following steps to check the certificate if is installed correctly.

You need to install and choose the same certificate on several places including RD session host server, RD Web Access, RD Gateway server, RemoteApp Manager.

1.       Start by importing the SSL certificate into the Computer Account.  MMC (Add/Remove Snapins - Certificates -Computer Account).  I imported the cert into the Pesonal and Remote Desktop stores.

2.       Import the SSL certificate into IIS.  Run IIS Manager, select the ServerName (left side Connections), under the IIS section, open Server Certificates, import the SSL certificate here.  Select the Web site (left side Connections), open Bindings (on the right side Actions) and associate/bind the wildcard cert with the appropriate https,host,port(443).

3.       TS RemoteApp Manager, Overview Section, Digital Signature Settings, Change, Digital Signature, Sign with a digital certificate checked Change, select the SSL certificate.

4.       TS Gateway Manager, select ServerName, Properties, SSL Certifcate tab, select an existing certificate for SSL encryption (recommended), Browse Certificates, select the SSL certificate.

5.       Terminal Services Configuration, Connections area, select appropriate connection, Properties, General tab, Select, select the SSL certificate.

Meanwhile, the certificates for RD Gateway must meet these requirements:

·         The name in the Subject line of the server certificate (certificate name, or CN) must match the DNS name that the client uses to connect to the RD Gateway server, unless you are using wildcard certificates or the SAN attributes of certificates. Multiple CNs are not supported. If your organization issues certificates from an enterprise certification authority (CA), a certificate template must be configured so that the appropriate name is supplied in the certificate request. If your organization issues certificates from a stand-alone CA, you do not need to do this.
·         The certificate is a computer certificate.
·         The intended purpose of the certificate is server authentication. The Extended Key Usage (EKU) is Server Authentication (1.3.6.1.5.5.7.3.1).
·         The certificate has a corresponding private key.
·         The certificate has not expired. We recommend that the certificate be valid one year from the date of installation.
·         A certificate object identifier (also known as OID) of 2.5.29.15 is not required. However, if the certificate that you plan to use contains an OID of 2.5.29.15, you can only use the certificate if at least one of the following key usage values is also set: CERT_KEY_ENCIPHERMENT_KEY_USAGE,CERT_KEY_AGREEMENT_KEY_USAGE, and CERT_DATA_ENCIPHERMENT_KEY_USAGE.
·         The certificate must be trusted on clients. That is, the public certificate of the CA that signed the RD Gateway server certificate must be located in the client's Trusted Root Certification Authorities store on the client computer.

Hope this helps.

Saturday, October 20, 2018

Deleting long directory names or deep nested folders

Eclipse created a temp folder in one of the directories which is nested quite deep, e.g.

dir1\dir1\dir1\dir1\...
I am unable to delete this folder in Windows via Explorer, the del or rmdir commands, nor the Cygwin 'rm' command. How should I remove this very long folder?

It just keeps saying "File name too long..."





If you are like me and don't like to install additional software to fix a problem like this, I'd go with XQYZ's suggestion and use robocopy to solve the problem. (In my case the problem was created by robocopy in the first place, by copying a directory which had recursive junction points in it without supplying /XJ to robocopy).

To delete the directory tree starting at c:\subdir\more\offending_dir:

The total step-by-step-process is as simple as this:

cd c:\subdir\more to cd into its parent directory.
mkdir empty to create an empty directory.
robocopy empty offending_dir /mir to mirror the empty directory into the offending one.
After some waiting you're done! Finish it up with:
rmdir offending_dir to get rid of the now empty offending directory and
rmdir empty to get rid of your intermediate empty directory.
source:

https://superuser.com/questions/256105/how-do-i-delete-a-folder-which-is-nested-quite-deep-and-avoid-file-name-too-lon

Monday, August 20, 2018

Hyperv and the Virtual switching - Vm's unable to access internet


https://community.spiceworks.com/topic/466370-event-id-2-hyper-v-netvsc-error-vm-and-host-failed-to-negotiate-protocol-v-5-0

Sonora
dbelleba Feb 19, 2016 at 7:02 PM
@ bevege (I realize hes probably not here but for anyone else who had problems like his I ran into the same thing not too long ago).



Theres a known bug with Hyperv and the Virtual switching. You can tell this if you've double checked everything and your vms get local traffic but no internet and your vm host gets local and internet or your vm host doesn't get internet but your vms do. So it basically one or the other.



The fix?



On the virtual switch uncheck the box that says "allow management operating system to share this adapter". Hit apply. Ok. Open it back up, recheck it, hit apply, ok. Whola fixed.

The bug is that when its preselected when the switch is created it doesn't apply correctly. So by rechecking it, its like a refresh. I spent about 4 hours network troubleshooting getting ready to rip the roof off and came across a bug report.



Anyone find a fix for the server 2012 vm hosts adding additional domain controllers in server 2012 R2 and getting stuck on NTDS installation?

Thanks!

Was this post helpful?
 Spice Reply

Pimiento
quirinocardozo Feb 21, 2016 at 4:13 PM 1ST POST
Hi all, after much head-banging, reading up everyone's frustrating stories and all of the R&D attempted, and almost at the verge of giving up and re-building the whole VM Host and VMs back to 2008 R2, dbellba's post above gave me a hint where to look.

- Although I could not find the "virtual switch" he's referring to, I did have a "Virtual Network Manager", which when I investigated displayed the name of the Host's NIC plus a "#2" extension to it.
- Below in the "Connection type", I tried selecting the main NIC that was physically connected to the LAN cable, received a warning that I would be temporarily disconnected - which I was, re-connected via VM-Host's IP
- Then after re-connecting, did a re-boot of the VM.

Guess what? It worked!!! My stubborn 2012 R2 VM's online now.

Hope this helps (and works!) for anyone else out there.

Found on Spiceworks: https://community.spiceworks.com/topic/466370-event-id-2-hyper-v-netvsc-error-vm-and-host-failed-to-negotiate-protocol-v-5-0?utm_source=copy_paste&utm_campaign=growth

https://community.spiceworks.com/topic/466370-event-id-2-hyper-v-netvsc-error-vm-and-host-failed-to-negotiate-protocol-v-5-0