[go: up one dir, main page]

0% found this document useful (0 votes)
197 views2 pages

Powershell Scripts

The document provides instructions for troubleshooting trust issues between a workstation and domain, enabling remote desktop with Powershell, installing software using an .exe file, enabling local admin for a user on different Windows versions, and enabling or disabling port 445.

Uploaded by

dani drumer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
197 views2 pages

Powershell Scripts

The document provides instructions for troubleshooting trust issues between a workstation and domain, enabling remote desktop with Powershell, installing software using an .exe file, enabling local admin for a user on different Windows versions, and enabling or disabling port 445.

Uploaded by

dani drumer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

The trust relationship between this workstation and the primary domain failed

Agar windows 7 bood motanaseb ba 64 bit ya 32 bit boodan,noskheye 3 powershell be


addresse: F:\Remote Software\WMF Powershell\Windows Management Framework 3.0 - 3-
Dec-2012 nasb shavad

Test-ComputerSecureChannel

False ro neshun mide (age True ro neshun bede k kolan moshkeli nist va by default rooye True hast)

Sepas:

Test-ComputerSecureChannel -Repair -Credential (Get-Credential Solico-group\a.mojarad)

Sepas bayad True shaved

Active RDP with Powershell:

Enter-PSSession –ComputerName TH10000002084 (for example)


Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name
"fDenyTSConnections" -Value 0

For more:
# Enabling Remote Desktop (RDP)
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name
"fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
# Network Level Authentication (NLA)
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal
Server\WinStations\RDP-Tcp' -Name "UserAuthentication" -Value 1
Test-NetConnection -ComputerName "10.9.0.1" -CommonTCPPort RDP

How to install .exe

For example:

PS C:\> cd 'E:\Remote Software\Crystal report 7 for SAP\Crystal report 7 for SAP'

[BHRGC5361.SOLICO-GROUP.COM]: PS E:\Remote Software\Crystal report 7 for SAP\Crystal report 7


for SAP> .\xSAPCRVAdpt.exe /nodlg /force

How to Enable Local admin for user in version 5 PS:

Get-Module -Name Microsoft.PowerShell.LocalAccounts -ListAvailable


Get-Command -Module Microsoft.PowerShell.LocalAccounts
$PSVersionTable
How to Enable Local admin for user in Before 5 version:
 Test-NetConnection -ComputerName $Computer -Port 445
$Computer = "ASDS"
$UserName = "S.Abedi"
([ADSI]"WinNT://$Computer.SOLICO-GROUP.COM/Administrators,Group").psbase.Invoke("Add",
([ADSI]"WinNT://Solico-Group/$UserName").path)
([ADSI]"WinNT://$Computer.SOLICO-
GROUP.COM/Administrators,Group").psbase.Invoke("Remove",([ADSI]"WinNT://Solico-Group/
$UserName").path)

How to Enable or disable Port 445:

Get-NetFirewallRule
Get-NetFirewallRule -Action Block

You might also like