search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Posted in Windows Powershell | No Comment | 2,039 views | 13/04/2016 13:22

There is no jscript limitation on PoSHServer.

However you need to use escape characters to make it work.

If you need to use something like this:

$(function() { $.ajax({

Then you should change your codes like this:

`$(function() {`$.ajax({

` is a escape character in PowerShell.


Posted in Windows Powershell | No Comment | 923 views | 04/03/2016 14:19

You can get detailed info about SQL Server Role properties via following code:

1
2
3
4
5
6
7
8
9
10
11
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
 
# Get SQL Roles
$MSSQLRoles = @($MSSQLServerManager.Roles)[0]
 
# Get SQL Logins Properties
$HostSQLRoleName = $MSSQLRoles.Name;
$HostSQLOwner = $MSSQLRoles.Owner;
$HostSQLIsFixedRole = $MSSQLRoles.IsFixedRole;
$HostSQLCreateDate = $MSSQLRoles.DateCreated;
$HostSQLDateLastModified = $MSSQLRoles.DateModified;

You can also check other properties by listing all properties of $MSSQLRoles.


Posted in Windows Powershell | No Comment | 1,077 views | 02/03/2016 16:12

You can get detailed SQL Server properties via following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
 
# Get SQL Logins
$MSSQLLogin = @($MSSQLServerManager.Logins)[0]
 
# Get SQL Logins Properties
$HostSQLLoginName = $MSSQLLogin.Name;
$HostSQLLoginType = $MSSQLLogin.LoginType;
$HostSQLLanguage = $MSSQLLogin.Language;
$HostSQLHasAccess = $MSSQLLogin.HasAccess;
$HostSQLDenyWindowsLogin = $MSSQLLogin.DenyWindowsLogin;
$HostSQLIsDisabled = $MSSQLLogin.IsDisabled;
$HostSQLIsLocked = $MSSQLLogin.IsLocked;

You can also check other properties by listing all properties of $MSSQLLogin.


Posted in Windows Powershell | No Comment | 897 views | 22/02/2016 11:02

You can get detailed SQL Server properties via following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
$HostSQLAuditLevel = $MSSQLServerManager.AuditLevel;
$HostSQLBuildClrVersionString = $MSSQLServerManager.BuildClrVersionString;
$HostSQLIsCaseSensitive = $MSSQLServerManager.IsCaseSensitive;
$HostSQLIsClustered = $MSSQLServerManager.IsClustered;
$HostSQLIsFullTextInstalled = $MSSQLServerManager.IsFullTextInstalled;
$HostSQLIsHadrEnabled = $MSSQLServerManager.IsHadrEnabled;
$HostSQLIsSingleUser = $MSSQLServerManager.IsSingleUser;
$HostSQLIsXTPSupported = $MSSQLServerManager.IsXTPSupported;
$HostSQLTcpEnabled = $MSSQLServerManager.TcpEnabled;
$HostSQLDefaultTextMode = $MSSQLServerManager.DefaultTextMode;
$HostSQLMaxPrecision = $MSSQLServerManager.MaxPrecision;
$HostSQLNamedPipesEnabled = $MSSQLServerManager.NamedPipesEnabled;

You can also check other properties by listing all properties of $MSSQLServerManager.


Posted in Windows Powershell | No Comment | 731 views | 15/02/2016 15:09

You can get SQL Server Endpoint information via following code:

1
2
3
4
5
6
7
8
9
10
11
12
13
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
 
# Get SQL Endpoints
$MSSQLEndpoint = @($MSSQLServerManager.Endpoints)[0]
 
# Get SQL Endpoint Properties
$HostSQLEndpointName = $MSSQLEndpoint.Name;
$HostSQLEndpointType = $MSSQLEndpoint.EndpointType;
$HostSQLProtocolType = $MSSQLEndpoint.ProtocolType;
$HostSQLOwner = $MSSQLEndpoint.Owner;
$HostSQLEndpointState = $MSSQLEndpoint.EndpointState;
$HostSQLIsAdminEndpoint = $MSSQLEndpoint.IsAdminEndpoint;
$HostSQLIsSystemObject = $MSSQLEndpoint.IsSystemObject;

You can also check other properties by listing all properties of $MSSQLEndpoint.


Posted in Windows Powershell | No Comment | 487 views | 07/02/2016 16:56

You can get detailed Service Account information via following code:

1
2
3
4
5
$MSSQLServerManager = New-Object 'Microsoft.SqlServer.Management.SMO.Server'
$HostSQLServiceAccount = $MSSQLServerManager.ServiceAccount;
$HostSQLServiceInstanceId = $MSSQLServerManager.ServiceInstanceId;
$HostSQLServiceName = $MSSQLServerManager.ServiceName;
$HostSQLServiceStartMode = $MSSQLServerManager.ServiceStartMode;

You can get Account, Service Start Mode, Service Name and Instance Id.


Posted in Windows Powershell | No Comment | 1,761 views | 04/02/2016 22:46

You can use [Microsoft.Win32.RegistryKey] to get remote registry values.

1
2
3
4
5
6
7
$ComputerName = "Server";
 
# Create Registry Connection
$RegistryConn = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey([Microsoft.Win32.RegistryHive]"LocalMachine", $ComputerName)
 
# Get Sub Key Names
$GetSubKeyNames = $RegistryConn.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\X\").GetSubKeyNames()

That will give you results.