Power Shell GUIDE

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

# firewall off

Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False

# mapping VirtualBox folder/directory

net use z: \\vboxsvr\Downloads


z:

#change keyboard

Set-WinUserLanguageList -Force 'es-ES'

# INSTALL .net framework


Install-WindowsFeature NET-Framework-Core -Source D:\Sources\SxS

# Check installed feature of IIS 10


Get-WindowsOptionalFeature -Online | where {$_.state -eq "Enabled"} | ft -Property
featurename

# Get all possible IIS features


Get-WindowsOptionalFeature -Online | where FeatureName -like 'IIS-*'

# Enable IIS for CGI


Enable-WindowsOptionalFeature -Online -FeatureName IIS-CGI

Enable-WindowsOptionalFeature -Online -FeatureName IIS-ASPNET, IIS-


NetFxExtensibility

#Enable HTTP Activation


Add-WindowsFeature NET-HTTP-Activation,NET-Non-HTTP-Activ

# Service get startup status


Get-Service -Name "schedule" | Set-Service -Status paused

# Service set startup status Automatic


Set-Service -Name BITS -StartupType Automatic

# SET network

netsh interface ipv4 show config


netsh interface ipv4 set address name = "Ethernet" static 192.168.21.151
255.255.255.0 192.168.21.1
netsh interface ipv4 set dns name = "Ethernet0" static 52.56.135.63
netsh interface ipv4 set dns name = "Ethernet0" static 8.8.8.8 index = 2
netsh interface ipv4 show config

# Rename computer
Rename-Computer -NewName solviapro-otds -LocalCredential Administrator -PassThru
Rename-Computer -NewName WIN-DSR30EI77KA -LocalCredential Administrator -PassThru

# Set file permission

$Acl = Get-Acl "C:\Program Files\IIS Administration\2.2.0\setup.config"


$Ar = New-Object
system.security.accesscontrol.filesystemaccessrule("Administrator","FullControl","A
llow")
$Acl.SetAccessRule($Ar)
Set-Acl "C:\Program Files\IIS Administration\2.2.0\setup.config" $Acl

# find file
Get-Childitem "Path C:\ -Include *.keystore* -File -Recurse -ErrorAction
SilentlyContinue"
or
dir secret.doc /s /p

#install telnet
install-windowsfeature "telnet-client"

# open firewall ports


netsh advfirewall firewall add rule name="Open Port CONTENTSERVER 2099" dir=in
action=allow protocol=TCP localport=2099
netsh advfirewall firewall add rule name="Open Port CONTENTSERVER 5858" dir=in
action=allow protocol=TCP localport=5858

# ps process list
While(1) {ps | sort -des cpu | select -f 15 | ft -a; sleep 1; cls}

# detail of process
Get-Process otds* | Format-List *

# start JETTY (Directory Service local of OPENTEXT Content Server


C:/OPENTEXT/jre/bin/otds -cp "C:/OPENTEXT/module/otdsintegration_16_2_0/ojlib/*" -
Xmx2048m com.opentext.otds.jetty.JettyServer start

# create system variable


set-item Env:AS_PREF_IP "4"

#get all system variable


Get-ChildItem Env:

#read a system variable value


$Env:AS_PREF_IP

# Remove/delete system variable


[Environment]::SetEnvironmentVariable("MyTestVariable",$null,"Machine")

#install java sinlently


.\jre-8u191-windows-x64.exe INSTALL_SILENT=Enable INSTALLDIR=C:\java\jre
WEB_JAVA_SECURITY_LEVEL=VH

# Uninstall programs
$app = Get-WmiObject Win32_Product | where { $_.name -eq "OpenText Administration
Client" }
$app.Uninstall()

#Service list
Get-Service
#only running services
Get-Service | Where-Object {$_.Status -eq "Running"}

#Service set to autostart


Set-Service -Name Tomcat8 -StartupType Automatic

Set-Service -Name "Tomcat8" -Status Running -PassThru


Set-Service -Name "Tomcat8" -Status Stopped
///////////////////////////////////////////////////////////////////////////////

You might also like