This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Check if the account exists. | |
If($Results.Count -eq 0) | |
{ | |
Write-Warning "The SamAccountName '$UserName' cannot find. Please make sure that it exists." | |
} | |
Else | |
{ | |
Foreach($Result in $Results) | |
{ | |
$DistinguishedName = $Result.Properties.Item("DistinguishedName") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE master | |
GO | |
PRINT β*******************************************************************************************β | |
PRINT β*******************************************************************************************β | |
PRINT β<SQL Server Instance Name>β | |
SELECT @@SERVERNAME | |
GO | |
PRINT β*******************************************************************************************β | |
PRINT β*******************************************************************************************β | |
PRINT β<SQL Server Version, Edition and Build>β |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dbnamefile1 = Get-ChildItem %RestorePath% | Where Name -Match ("DB-Name") | |
$dbname1 = "DB-Name" | |
Restore-SqlDatabase -ServerInstance %SQLSERVER% -Database $dbname1 -BackupFile "%RestorePath%\$dbnamefile1" | |
$dbnamefile2 = Get-ChildItem %RestorePath% | Where Name -Match ("DB-Name") | |
$dbname2 = "DB-Name" | |
Restore-SqlDatabase -ServerInstance %SQLSERVER% -Database $dbname1 -BackupFile "%RestorePath%\$dbnamefile1" | |
$dbnamefile3 = Get-ChildItem %RestorePath% | Where Name -Match ("DB-Name") | |
$dbname3 = "DB-Name" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install Samba | |
Check for existing samba package if any using the following commands. | |
rpm -qa | grep samba | |
yum list installed | grep samba | |
If samba is installed, remove it using the below command: | |
yum remove samba* | |
Now, install samba using the following command. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%windir%\system32\inetsrv\appcmd list site "site" /config /xml > c:\mywebsite.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongod --dbpath "C:\Program Files\MongoDB\Server\3.4\database" --logpath "C:\Program Files\MongoDB\Server\3.4\logs" --install --serviceName "MongoDB Server" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongodump -h localhost -c New Collection -o F:\mongodb_backup\Dest_SingleCollBkp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$date = Get-Date -UFormat %Y-%m-%d; | |
$backupFolder = $date; | |
$basePath = "F:\mongodb_backup"; | |
$destinationPath = Join-Path $basePath $backupFolder; | |
if(!(Test-Path -Path $destinationPath)) { | |
New-Item -ItemType directory -Path $destinationPath; | |
(C:\mongodump.exe --out $destinationPath); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Const MSG_RECIPIENT_LIST = "[email protected]" | |
Const MSG_SUBJECT = "Some Subject" | |
Const MSG_BODY = "Testing" | |
Dim olkApp, olkSes, olkMsg | |
Set olkApp = CreateObject("Outlook.Application") | |
Set olkSes = olkApp.GetNamespace("MAPI") | |
olkSes.Logon olkApp.DefaultProfileName | |
Set olkMsg = olkApp.CreateItem(0) | |
With olkMsg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#we specify the directory where all files that we want to upload | |
$Dir="C:/Dir" | |
#ftp server | |
$ftp = "ftp://xxx.xxx.xxx/dir/" | |
$user = "user" | |
$pass = "Pass" | |
$webclient = New-Object System.Net.WebClient | |
OlderNewer