DROP Iptables

iptables -A INPUT -s 172.16.2.20 -j DROP
iptables -A OUTPUT -d 172.16.2.20 -j DROP

Créditos: http://paulovittor23.org/2011/10/31/bloqueando-acesso-ip-utilizando-iptables/

Setar Senha do Usuário do Office 365 para que nunca expire

Baixar e instalar o Microsoft Online Services Sign-in Assistant Install Windows Azure AD

For single user

Connect to Windows PowerShell using Admin credentials

Connect-MsolService

Set-MsolUser -UserPrincipalName <user ID> -PasswordNeverExpires $true

For all users

Get-MSOLUser | Set-MsolUser -PasswordNeverExpires $true


How to check whether the password is set to never expire

For single user

Get-MSOLUser -UserPrincipalName <user ID> | Select PasswordNeverExpires

For all users

Get-MSOLUser | Select UserPrincipalName, PasswordNeverExpires

Créditos: https://dilshansaminda.wordpress.com/2014/08/05/office365-setup-user-password-to-never-expire/

Alterar/Hackear Senha Administrador Domínio Windows Server

Well this tutorial shows you how to hack any Admin account or any privilege account on any WINDOWS based operating system.

Press shift key 5times or more, you will see a sticky key option, this has a name as sethc.exe in the system32 folder of windows directory.

for this whole process we need administrative privilages to allow modifications in the system32 folder for windows vista or Windows 7 so inorder to gain that access remotely follow the parameters :

Steps to do this using Command Prompt :

1. Open command prompt with administrative privileges and type in the following :

cd\
c:\cd windows\system32
c:\windows\system32> takeown /f sethc.exe

(this command basically gives you the ownership to that particular file. Now we have to gain administrative privilege on that file to do that -)

c:\windows\system32> icacls sethc.exe /grant administrators: f

now do this again for cmd.exe file :

c:\windows\system32> takeown /f cmd.exe
c:\windows\system32> icacls cmd.exe /grant administrators: f

Now as we have control on both the files follow these :

1. Delete or rename sethc.exe with someother name.
2. Make a duplicate copy of cmd.exe file and then rename it with “sethc.exe” without quotes.
3. Now ensure that you have 2 copies of cmd.exe, one is the original cmd.exe file and the other which is    renamed as sethc.exe

Now when you press shift 5times or more you get a command prompt instead of a sticky key window prompt.

now you can use this command prompt to gain access to that computer as follows:

Now when you have replaced that duplicate cmd with sethc.exe command prompt will appear as soon as you  press the shift key 5times or more do this at the time of logon.

When the console asks you for the password press shift key 5times or more to get the command prompt.
Now type in the following :

net user <username> *                          (Press enter it will ask you for a password)

for example my username is Admin:

net user admin *
type a new password :
confirm password      :

fill it blank and you have reset the password of that account. Now type “exit” without quotes to get out of the command prompt and select the arrow button of windows vista/7 or press enter for windows xp to bypass the login screen.

Extreme users can use the above replacement of sethc.exe with cmd.exe without having to logged in to the computer. Nube skill users can use it in logged in computers.

Créditos: http://hackinfoworld.blogspot.com.br/2011/01/sticky-keys-and-command-prompt-hack.html

Consultar FSMO

netdom query fsmo

Conectar Microsoft Online Services

  1. Faça o download e instale o Powershell para o Office 365
  2. Após a instalação, execute o novo programa com direitos de Administrador
  3. Execute os seguintes comandos para criar uma sessão nas nuvens
    • $livecred = Get-Credential
      • Após esse comando você deve informar suas credenciais de administrador do Office 365
    • Connect-MsolService -Credential $livecred
    • $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
      • Se ocorrer algum erro de conexão, execute os comandos abaixo:
        • Set-executionpolicy unrestricted
        • Set-ExecutionPolicy RemoteSigned
    • Import-PSSession $Session
    • Enable-OrganizationCustomization

Créditos: https://ehrizo.wordpress.com/2013/03/20/office-365-como-desbloquear-determinadas-extensoes-de-arquivos-nos-anexos-do-outlook-web-access-owa/
Créditos: http://mauriciocassemiro.com/2013/07/05/problema-resolvido-com-implantao-das-novas-verses-do-mdulo-windows-azure-active-directory-para-windows-powershell-novo-assistente-de-conexo-do-microsoft-onlin/

 

Verificar – Liberar anexos Office 365

Para verificar as extensões já liberadas

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | select -ExpandProperty allowedfiletypes

Para verificar as extensões bloqueadas

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | select -ExpandProperty blockedfiletypes

Remover extensão da lista de bloqueados: Ex.: xml

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy -BlockedFileTypes @{Remove = “.xml”}

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy -BlockedMimeTypes @{Remove = “text/xml”, “application/xml”}

Adicionar na lista de extensões permitidas

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy –AllowedFileTypes @{Add = “.xml”}

Get-OwaMailboxPolicy OwaMailboxPolicy-Default | Set-OwaMailboxPolicy -AllowedMimeTypes @{Add = “text/xml”, “application/xml”}

Pronto a extensão já está liberada para a politica OwaMailboxPolicy-Default

Caso queira bloquear basta substituir:  “–AllowedFileTypes @{Add = “.xml”} ” por “–BlockedFileTypes @{Add = “.xml”} “ e  “BlockedMimeTypes @{Remove = “text/xml”, “application/xml”} ” por  “AllowedMimeTypes@{Remove = “text/xml”, “application/xml”} ”

Créditos: http://brunofeliciano.com/2014/01/24/liberar-extenso-de-anexo-no-owa-wave15office-365/

Extra:

Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -BlockedFileTypes @{Remove = ".xml"}
Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -AllowedFileTypes @{Add = ".xml"}
Get-OwaMailboxPolicy | Set-OwaMailboxPolicy -BlockedMimeTypes @{Remove = "text/xml", "application/xml”}
Get-OwaMailboxPolicy | Set-OwaMailboxPolicy –AllowedMimeTypes @{Add = "text/xml", "application/xml”}

Boot VM em CD/DVD quando VM não tem suporte

In order to boot from cd or dvd you need to change the guest virtualization type from HVM (fully virtualized) to PV (paravirtualized).

xe vm-param-set HVM-boot-policy="BIOS order" uuid=[uuid of your vm]

After you have booted from dvd, change back to fully virtualized mode:

xe vm-param-set HVM-boot-policy="" uuid=[uuid of your vm]

 

Créditos: http://www.xenlens.com/boot-a-guest-vm-from-cd-or-dvd-in-xenserver

Parar serviço Windows que fica em STOPPING

# sc queryex servicename

# taskkill /f /pid [PID]

Créditos: http://www.examiner.com/list/how-to-kill-a-windows-service-that-s-stuck-on-stopping-or-starting

Trocar senha vários usuários AD

DSQUERY user "OU=myOU,OU=myUsers,DC=myDomain,DC=loc" -limit 0 | DSMOD user -pwd <insert new password here>

 

Outros comandos mais usados.

http://windowsitpro.com/powershell/top-10-active-directory-tasks-solved-powershell

Recovery Windows 2008

I would like to suggest you rename the current registry files and restore the registry files from the RegBack folder to troubleshoot the issue.

1. Insert the Windows Server 2008 R2 installation disc in the optical drive, and then restart the computer.
2. Press any key when you are prompted to restart from the disc.
3. When you are prompted, configure the Language to install, Time and currency format, and Keyboard or input method options that you prefer, and then click “Next”.
4. On the Install Windows page, click “Repair your computer”.
5. On the System Recovery Options page, click the version of the Windows Vista operating system that you want to repair, and then click “Next”.
6. On the System Recovery Options page, click “Command Prompt”.
7. Type the following command lines:

Cd  C:\windows\system32\config\
Ren  default  default.old
Ren  sam  sam.old
Ren  security  security.old
Ren  software  software.old
Ren  system  system.old
Cd  C:\windows\system32\config\regback\default
Copy  default  C:\windows\system32\config  /y
Copy  sam  C:\windows\system32\config  /y
Copy  security  C:\windows\system32\config  /y
Copy  software  C:\windows\system32\config  /y
Copy  system  C:\windows\system32\config  /y

8. Restart the computer

Créditos: http://mirrado.blogspot.com.br/2013/04/recuperar-windows-2008-r2-com-recovery.html