24 Aralık 2019 Salı

VMware / Unable to passthrough a USB smart card reader to a guest operating system in ESXi version 6.5 and later

ESXi üzerinde usb token kullanmak istediğimizde aşağıdaki hata mesajı ile karşılaşabiliriz.





Status: Cannot connect 'path:0/1/0/1' to this virtual machine. The device was not found.


USB aygıtı kullanabilmek için sanal makine kapalı iken .vmx dosyasına aşağıddaki satır eklenmeli.

  • Power of the VM
  • Append the following line to your VM configuration (.vmx)
    usb.generic.allowCCID = "TRUE"
Düzenleme sonrası sanal makine ayarlarının değiştirilmesi bu değişikliğin ezilmesine sebep olabilir.

Aynı ayarları sanal makine üzerinden de yapabiliriz.


3 Aralık 2019 Salı

MS-SQL / Transfer logins and passwords

Transfer logins and passwords to destination server (Server A) using scripts generated on source server (Server B)

To create a log in script that has a blank password, follow these steps:

On server A, start SQL Server Management Studio, and then connect to the instance of SQL Server from which you moved the database.
Open a new Query Editor window, and then run the following script.

USE master
GO
IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
  DROP PROCEDURE sp_hexadecimal
GO
CREATE PROCEDURE sp_hexadecimal
    @binvalue varbinary(256),
    @hexvalue varchar (514) OUTPUT
AS
DECLARE @charvalue varchar (514)
DECLARE @i int
DECLARE @length int
DECLARE @hexstring char(16)
SELECT @charvalue = '0x'
SELECT @i = 1
SELECT @length = DATALENGTH (@binvalue)
SELECT @hexstring = '0123456789ABCDEF'
WHILE (@i <= @length)
BEGIN
  DECLARE @tempint int
  DECLARE @firstint int
  DECLARE @secondint int
  SELECT @tempint = CONVERT(int, SUBSTRING(@binvalue,@i,1))
  SELECT @firstint = FLOOR(@tempint/16)
  SELECT @secondint = @tempint - (@firstint*16)
  SELECT @charvalue = @charvalue +
    SUBSTRING(@hexstring, @firstint+1, 1) +
    SUBSTRING(@hexstring, @secondint+1, 1)
  SELECT @i = @i + 1
END

SELECT @hexvalue = @charvalue
GO

IF OBJECT_ID ('sp_help_revlogin') IS NOT NULL
  DROP PROCEDURE sp_help_revlogin
GO
CREATE PROCEDURE sp_help_revlogin @login_name sysname = NULL AS
DECLARE @name sysname
DECLARE @type varchar (1)
DECLARE @hasaccess int
DECLARE @denylogin int
DECLARE @is_disabled int
DECLARE @PWD_varbinary  varbinary (256)
DECLARE @PWD_string  varchar (514)
DECLARE @SID_varbinary varbinary (85)
DECLARE @SID_string varchar (514)
DECLARE @tmpstr  varchar (1024)
DECLARE @is_policy_checked varchar (3)
DECLARE @is_expiration_checked varchar (3)

DECLARE @defaultdb sysname

IF (@login_name IS NULL)
  DECLARE login_curs CURSOR FOR

      SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM 
sys.server_principals p LEFT JOIN sys.syslogins l
      ON ( l.name = p.name ) WHERE p.type IN ( 'S', 'G', 'U' ) AND p.name <> 'sa'
ELSE
  DECLARE login_curs CURSOR FOR


      SELECT p.sid, p.name, p.type, p.is_disabled, p.default_database_name, l.hasaccess, l.denylogin FROM 
sys.server_principals p LEFT JOIN sys.syslogins l
      ON ( l.name = p.name ) WHERE p.type IN ( 'S', 'G', 'U' ) AND p.name = @login_name
OPEN login_curs

FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin
IF (@@fetch_status = -1)
BEGIN
  PRINT 'No login(s) found.'
  CLOSE login_curs
  DEALLOCATE login_curs
  RETURN -1
END
SET @tmpstr = '/* sp_help_revlogin script '
PRINT @tmpstr
SET @tmpstr = '** Generated ' + CONVERT (varchar, GETDATE()) + ' on ' + @@SERVERNAME + ' */'
PRINT @tmpstr
PRINT ''
WHILE (@@fetch_status <> -1)
BEGIN
  IF (@@fetch_status <> -2)
  BEGIN
    PRINT ''
    SET @tmpstr = '-- Login: ' + @name
    PRINT @tmpstr
    IF (@type IN ( 'G', 'U'))
    BEGIN -- NT authenticated account/group

      SET @tmpstr = 'CREATE LOGIN ' + QUOTENAME( @name ) + ' FROM WINDOWS WITH DEFAULT_DATABASE = [' + @defaultdb + ']'
    END
    ELSE BEGIN -- SQL Server authentication
        -- obtain password and sid
            SET @PWD_varbinary = CAST( LOGINPROPERTY( @name, 'PasswordHash' ) AS varbinary (256) )
        EXEC sp_hexadecimal @PWD_varbinary, @PWD_string OUT
        EXEC sp_hexadecimal @SID_varbinary,@SID_string OUT

        -- obtain password policy state
        SELECT @is_policy_checked = CASE is_policy_checked WHEN 1 THEN 'ON' WHEN 0 THEN 'OFF' ELSE NULL END FROM sys.sql_logins WHERE name = @name
        SELECT @is_expiration_checked = CASE is_expiration_checked WHEN 1 THEN 'ON' WHEN 0 THEN 'OFF' ELSE NULL END FROM sys.sql_logins WHERE name = @name

            SET @tmpstr = 'CREATE LOGIN ' + QUOTENAME( @name ) + ' WITH PASSWORD = ' + @PWD_string + ' HASHED, SID = ' + @SID_string + ', DEFAULT_DATABASE = [' + @defaultdb + ']'

        IF ( @is_policy_checked IS NOT NULL )
        BEGIN
          SET @tmpstr = @tmpstr + ', CHECK_POLICY = ' + @is_policy_checked
        END
        IF ( @is_expiration_checked IS NOT NULL )
        BEGIN
          SET @tmpstr = @tmpstr + ', CHECK_EXPIRATION = ' + @is_expiration_checked
        END
    END
    IF (@denylogin = 1)
    BEGIN -- login is denied access
      SET @tmpstr = @tmpstr + '; DENY CONNECT SQL TO ' + QUOTENAME( @name )
    END
    ELSE IF (@hasaccess = 0)
    BEGIN -- login exists but does not have access
      SET @tmpstr = @tmpstr + '; REVOKE CONNECT SQL TO ' + QUOTENAME( @name )
    END
    IF (@is_disabled = 1)
    BEGIN -- login is disabled
      SET @tmpstr = @tmpstr + '; ALTER LOGIN ' + QUOTENAME( @name ) + ' DISABLE'
    END
    PRINT @tmpstr
  END

  FETCH NEXT FROM login_curs INTO @SID_varbinary, @name, @type, @is_disabled, @defaultdb, @hasaccess, @denylogin
   END
CLOSE login_curs
DEALLOCATE login_curs
RETURN 0
GO

This script creates two stored procedures in the master database. The procedures are named sp_hexadecimal and sp_help_revlogin.

Run the following statement in the same or a new query window:

EXEC sp_help_revlogin

The output script that the sp_help_revlogin stored procedure generates is the login script.
This login script creates the logins that have the original Security Identifier (SID) and the original password.

Steps on the destination server (Server B):

On server B, start SQL Server Management Studio, and then connect to the instance of SQL Server to which you moved the database.

Open a new Query Editor window, and then run the output script that's generated in step 2 of the preceding procedure.


https://support.microsoft.com/en-us/help/246133/how-to-transfer-logins-and-passwords-between-instances-of-sql-server


22 Kasım 2019 Cuma

NetBackup / To verify NetBackup daemons or services on linux

/usr/openv/netbackup/bin/bpps -x

servername:/usr/openv/netbackup/bin # /usr/openv/netbackup/bin/bpps -x
NB Processes
------------
root      72130      1  0 15:53 ?        00:00:00 /usr/openv/netbackup/bin/vnetd -proxy inbound_proxy -number 0
root      72131      1  0 15:53 ?        00:00:00 /usr/openv/netbackup/bin/vnetd -proxy outbound_proxy -number 0
root      72187      1  0 15:53 ?        00:00:00 /usr/openv/netbackup/bin/vnetd -standalone
root      72192      1  0 15:53 ?        00:00:00 /usr/openv/netbackup/bin/bpcd -standalone
root      72277      1  0 15:53 ?        00:00:00 /usr/openv/netbackup/bin/nbdisco


Shared Veritas Processes
-------------------------
root      67572      1  0 15:34 ?        00:00:00 /opt/VRTSpbx/bin/pbx_exchange
servername:/usr/openv/netbackup/bin #

21 Kasım 2019 Perşembe

VMware/ Disable VSS application quiescing using VMware Tools

  1. Open the C:\ProgramData\VMware\VMware Tools\Tools.conf file using a text editor.
  2. Create the file if it does not exist in the above said location
  3. Add these entries to the file:

    [vmbackup]
    vss.disableAppQuiescing = true

     
  4. Save and close the file.
  5. Restart the VMware Tools Service.
    1. Click Start Run, type services.msc, and click OK.
    2. Right-click the VMware Tools Service and click Restart.

4 Ekim 2019 Cuma

NetBackup / Linux üzerinde NetBackup Client kurulumu

tar -xzvf NetBackup_8.2_CLIENTS2.tar.gz

server_name:/tmp/nb/NetBackup_8.2_CLIENTS2 # ./install


Veritas Installation Script
Copyright (c) 2019 Veritas Technologies LLC. All rights reserved.


        Installing NetBackup Client Software


Please review the VERITAS SOFTWARE LICENSE AGREEMENT located on
the installation media before proceeding. The agreement includes
details on the NetBackup Product Improvement Program.

For NetBackup installation and upgrade information specific to your
platform and to find out if your installed EEBs or hot fixes are
contained in this release, check the Installation and Upgrade checklists
and the Hot Fix and EEB Release Auditor, both available on the Veritas
Services and Operations Readiness Tools (SORT) page:
https://sort.veritas.com/netbackup.

Do you wish to continue? [y,n] (y)

DELL EMC / IPMI Tool 1.8.18

IPMI Tool 1.8.18

This tool provides Serial Over LAN functionality for the VNXe3200, VNXe1600 and Dell EMC Unity hardware products.

The IPMI Tool is a Windows command prompt utility that is used to establish a Serial-over-LAN connection to the Unity Service Processors (SPs).

The IPMI Tool is useful if you do not have Unisphere access.



Configure the laptop with an IP address for the Service LAN network: 
     
128.221.1.250, netmask 255.255.255.0, no gateway required.     
       
Open command prompts, and use the following syntax to connect to each SP:

c:\> ipmitool.exe -I lanplus -C 3 -U console -P UNITY_SERIAL_NUMBER -H 128.221.1.252 sol activate

c:\> ipmitool.exe -I lanplus -C 3 -U console -P UNITY_SERIAL_NUMBER -H 128.221.1.253 sol activate



spb:~> svc_diag     
        ======== Now executing basic state ========     
        * System Serial Number is: FNM0015xxxxxxx     
        * System Friendly Host Name is:     
        * Current Software version: upc_Unity_2_9_upcBuilder-4.0.0.7329527-GNOSIS_RETAIL     
        * Unisphere IP address(es): xx.xx.xx.xx xxxxxxxxxxxxxxxxxxxxxxxx     
        * SSH Enabled: true     
        * FIPS mode: Disabled     
        * Boot Mode: Normal Mode     
        -----abbreviated----------- 
 
   
Note:  Each SP will show its "Boot Mode" as "Normal Mode" if the system is running normally. 

If one or more SPs are having an issue, the "Boot Mode" may show as "Rescue Mode" (i.e, Service Mode): 
 
spa:~> svc_diag     
        ======== Now executing basic state ========     
        * System Serial Number is: FNM0015xxxxxxx     
        * System Friendly Host Name is:     
        * Current Software version: upc_nextUnity_mcs_20160607xxx_upcBuilder-4.1.0.7769613-GNOSIS_RETAIL     
        * Unisphere IP address(es): xx.xx.xx.xx xxxxxxxxxxxxxxxxxxxxxxxx     
        * SSH Enabled: true     
        * FIPS mode: Disabled     
        * Boot Mode: Rescue Mode     
        ----abbreviated---- 



Examples:

spa:~> svc_rescue_state -l  --> Lists the Rescue State codes     

spa:~> svc_rescue_state -c  --> Clears the Rescue State flag     

spa:~> svc_shutdown -r      --> Reboots the SP from where you are running the command 

spa:~> pgrep ECOM   
      20291   -->Return of a Process ID indicates that this is the Primary SP 
 
spa:~> uemcli /sys/general show   
      1:    System name           = u300   
            Model                 = Unity 300   
            Platform type         = EMC Storage System   
            Product serial number = FNM00153xxxxxx   
            Auto failback         = on   
            Health state          = OK (5) 
 
spa:~> svc_help     
     
spa:~> df   
      Filesystem        1K-blocks    Used Available Use% Mounted on   
      /dev/mapper/eroot  11226476 5750304   4883076  55% /  ---output abridged---- 


https://community.emc.com/docs/DOC-63404


27 Haziran 2019 Perşembe

NetBackup / could not set user ID for process (31)

could not set user ID for process  (31) SAP oracle backup hatası ile ilgili olarak

Windows sunucu üzerinde UAC özelliğini kapatmak çözüm oldu.

HKEY_LOCAL_MACHINE

SOFTWARE Microsoft > Windows > CurrentVersion > Policies > system içerisindeki

EnableLUA değerini 0 yapmak gerekiyor.

Jun 27, 2019 4:36:50 PM - Info bpbrm (pid=13200) accepted connection from client
Jun 27, 2019 4:36:50 PM - Info bpbrm (pid=13200) start bpbkar on client
Jun 27, 2019 4:36:50 PM - connected; connect time: 0:00:00
Jun 27, 2019 4:36:51 PM - Error bpbrm (pid=13200) from client SERVERNAME: ERR - setuid failed: 'username'
Jun 27, 2019 4:36:51 PM - Info dbclient (pid=0) done. status: 31: could not set user id for process
Jun 27, 2019 4:36:51 PM - Info dbclient (pid=0) done. status: 31: could not set user id for process
Jun 27, 2019 4:36:51 PM - end writing
could not set user ID for process  (31)

21 Haziran 2019 Cuma

MS-SQL / user already exists in the current database, error: 15023

User, group, or role 'user_name' already exists in the current database. 
(Microsoft SQL Server, Error: 15023)

Restore sonrası kullancı açılması ile db üzerinde çalıştırılacak komut:

sp_change_users_login 'AUTO_FIX', 'user_name'

23 Mayıs 2019 Perşembe

SUSE / Template den Yeni Sanal Makine Oluşturma

SUSE template makinesinden yeni sanal makine oluşturmak için aşağıdaki adımları kullanabiliriz.

1. SUSE_TEMP makinesi kullanılara yeni sanal makine oluşturulur.

2. root - password bilgileri ile konsol açılır.

3. hostnamectl set-hostname yeni_hostname komutu ile yeni sunucu adı tanımlanır.

4. nano /etc/sysconfig/network/ifcfg-eth0 komutu ile dosya açılarak, IPADDR= satırındaki IP adresi degiştirilerek dosya kaydedilir.

5. nano /etc/hosts komutu ile dosya açılarak, yeni IP adresi ve hostname düzenlenip dosya kaydedilir.

6. reboot komutu ile sistem yeniden başlatılır.

11 Ocak 2019 Cuma

Move computers to another OU using a text file

Move computers to another OU using a text file

$computers = Get-Content C:\computers.txt
$TargetOU   =  "OU=DENEME,DC=domain,DC=com,DC=tr"
ForEach( $computer in $computers)
{
    Get-ADComputer $computer |
    Move-ADObject -TargetPath $TargetOU
}

Windows Server IIS üzerinden hizmet veren bir FTP servisine erişmek istediğimizde;  Internet Explorer, FileZilla vb. uygulamalar ile erişim ...