Réactiver licence Office

De Wiki du sac

Par l'invite de commande (CMD)

cd "C:\Program Files\Microsoft Office\Office16" 
cscript ospp.vbs /act 


Script powershell pour reactiver à distance toutes les versions d'office:


# mettre le bon numéro d'ordinateur
cls  
$RemoteComputer  = "222144pt"   
$SessionArgs = @{ 
     ComputerName = $RemoteComputer  
     #Credential    = Get-Credential 
     SessionOption = New-CimSessionOption -Protocol Dcom 
} 
$MethodArgs = @{ 
    ClassName     = 'Win32_Process' 
    MethodName    = 'Create' 
    CimSession    = New-CimSession @SessionArgs 
    Arguments     = @{ 
        CommandLine = "powershell Start-Process powershell -ArgumentList 'Enable-PSRemoting -Force'" 
    } 
} 

Invoke-CimMethod @MethodArgs 
Invoke-Command -ComputerName $RemoteComputer -ScriptBlock{ 
  $allospp = @("C:\Program Files\Microsoft Office", "C:\Program Files (x86)\Microsoft Office") | %{ Get-ChildItem  $_ -recurse | Where-Object {$_.fullname -like "*ospp.vbs"} | Select-Object -expandproperty fullname } 

  foreach ($thisospp in $allospp) 

  { 
       cscript $thisospp /act 
  } 
}

Retour à Microsoft Office