Untitled1.ps1

netdom renamecomputer Exchange /newname:OOS2 /userd:contoso\administrator /passwordd:* /usero:contoso\administrator /passwordo:* /reboot:10 /force
LS1setup!

$OOSmachine=read-host -prompt "Input OOS machine name"
$oossetup=Read-host -prompt "Input path to OOS setup.exe (no quotation marks!)"
$oosconfig="C:\oosconfig.xml"
Set-content $oosconfig '<Configuration>
            <Logging Type="verbose" Path="C:\tmp" Template="OOServerSetup(*).log"/>
            <Display Level="none" CompletionNotice="no" />
            <INSTALLLOCATION Value="C:\Program Files\Microsoft Office Online Server\"/>
            <Setting Id="USINGUIINSTALLMODE" Value="0"/>
            <Setting Id="SETUPTYPE" Value="CLEAN_INSTALL"/>
            <Setting Id="SETUP_REBOOT" Value="Never"/>
        </Configuration>'


Start-Process "$oossetup" -ArgumentList "/config C:\OOSconfig.xml" -Wait
Restart-Computer -force

Publish-Module -Name OCSImaster -NuGetApiKey "oy2ciypvh25tmvt3zhrauzviibqlz5gupigkcczq4wiipi"


$cert = New-SelfSignedCertificate -CertStoreLocation Cert:\CurrentUser\My -Type CodeSigningCert -Subject "Georgian Ionita signed"
Get-ChildItem -Path Cert:\CurrentUser\My | ? Subject -EQ "CN=Georgian Ionita signed"
Move-Item -Path $cert.PSPath -Destination "Cert:\CurrentUser\Root"
Set-AuthenticodeSignature -FilePath "C:\Users\geionit\Documents\WindowsPowershell\Modules\OCSImaster\OCSImaster.psm1" -Certificate $cert