jump to navigation

Comandos Power Shell Utiles May 27, 2012

Posted by juanpablo1manrique in SharePoint.
trackback
  • Consultar todas las templates instaladas
    • $web.webtemplate | format-list
    • to file
    •  $list.items | Out-File C:\filename.txt
  • Reduce WSS_Logging
    • $defs = Get-SPUsageDefinition
      Foreach($def in $defs)
      {
      Set-SPUsageDefinition –Identity $def.Name –DaysRetained 1
      }
  • Query with Row Line number
    • SELECT TOP 10 ROW_NUMBER() OVER (Order by [col1]) AS RowNumber,[col1]
      FROM [dbo].[Table]
  • excel arrow moves sheet not cell
    • Windows
    • On-Screen Keyboard
    • When the on-screen keyboard appears, click the ScrLk or Slk button
  • WSDL.exe
    • WSDL.exe /language:CS /namespace:FourCalc /out:c:\Captures\FourCalc.cs http:\\localhost/FourFunctionCalc/Service1.asmx?sdl
  • psconfig -cmd upgrade -inplace b2b
  • read PublicKeyToken> en power shell
    • ([system.reflection.assembly]::loadfile(“c:\MyVerificationDLL.dll”)).FullName
  • PrerequisiteInstaller.exe /?
    • Muestra los prerequisitos de esa versión
  • Broacast skype 365 URL
  • Borrar usuarios
  • Connect SharePoint Online
  •  Allow MimeType
    • $webApp  = Get-SPWebApplication http://sharepoint.contoso.co
    • # current allowed mimetypes
    • $webApp.AllowedInlineDownloadedMimeTypes
    • # add the text/html mime type
    • $webApp.AllowedInlineDownloadedMimeTypes.Add(‘text/html’)
    • $webApp.Update()
  • Set Office 365 never expires
    •  Set-MsolUser -UserPrincipalName “userprincipalname” –PasswordNeverExpires $true
  • MicrosoftEasyFix20150
    • fix sync issues with OneDrive for Business automatically
  • Get all assembly
    • gacutil -l >yourassemblies.txt
  • CamlQuery query = CamlQuery.CreateAllItemsQuery()
  • CamlQuery query = CamlQuery.CreateAllItemsQuery(100)
  • URL view all users
    • …/_layouts/15/people.aspx?MembershipGroupId=0
  • Otorgar permisos a la base de datos de configuración
      • Add-SPShellAdmin aaa\bbbb
  • Manage property bags
    • $web = GEt-spweb “http://www.misite.com/subsite/”
    • $web.Properties[“prop1”] = “88888”
    • $web.Properties[“prop2”] = “0010”
    • $web.Properties.Update();
    • $web.Update();
  • Shutdown . Apagar por comandos
    • shutdown /r /t 0
  • Copy Paste error
    • rdpclip.exe
  • Obtener el listado de listas de un sitio
  • PowerShell
    • add-PSSnapIn “Microsoft.SharePoint.Powershell”
  • Crear sitio de Educacion
  • Upgrade several sitecollections
    • get-spsite -limit all | Upgrade-SPSite -VersionUpgrade -Unthrott
  • Computer Management
    • compmgmt.msc
  • Sincronizar el reloj HORA
    • w32tm /resync
  • Usage Logs
    • _layouts/usagedetails.aspx
  • Activar Features en el web
    • Get-SPSite http://misitio/ | Get-SPWeb -Limit ALL |%{ Get-SPFeature -Web $_ } | Select DisplayName,ID -Unique
    • Enable-SPFeature -identity “9a447926-5937-44cb-857a-d3829301c73b” -URL http://misitio/
  • Activar Features en el site
    • Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq “SITE”}
    • Enable-SPFeature -identity “9a447926-5937-44cb-857a-d3829301c73b” -URL http://misitio/
  • Administrar Tipos de Contenido Huerfanos
    • SELECT [SiteId],[Class],[Scope],sys.fn_varbintohexstr([ContentTypeId]) as CT,[Version],[NextChildByte],[Size],[Definition],[ResourceDir],[IsFromFeature]FROM [dbo].[ContentTypes]where (sys.fn_varbintohexstr(ContentTypeId) LIKE ‘0x010010bd6c5%’)
    • Update [dbo].[ContentTypes]set [IsFromFeature] = 0where (sys.fn_varbintohexstr(ContentTypeId) LIKE ‘0x010010bd6c5%’)
    • delete [dbo].[ContentTypes]where (sys.fn_varbintohexstr(ContentTypeId) LIKE ‘0x010010bd6c5%’)
  • Elevarse permisos en SQL SERVER
    • SQLCMD –E -S ‘Domain\Account’
    • exec sp_addsrvrolemember @loginame=’Domain\Account’,@rolename=’sysadmin’
    • Reiniciar servico SQL SERVER
  • Comando para un copiar-pegar inteligente
    • xcopy “E:\Source\MyProject\styles\*.*” “E:\Destine\MyProject\styles\*.*” /EXCLUDE:C:\FileList.txt /d/e/y/i
  • Obtener el listado de archivos de un folder con subfolders
    • dir /s /b>FileList.txt
  • Borrar una lista corrupta
    • $web = get-spweb -Identity http://sp2010
    • $web.lists | select Title
    • $list = $web.lists[“corrupted list name”]
    • $list.AllowDeletion = $true
    • $list.Update()
    • $list.Delete()
  • — reset the logging thresholds loggin SharePoint
    • stsadm -o setlogginglevel -category IRM -default
    • Get-SPLogLevel | Clear-SPLogLevel
  • to windows config hour sinchronize whit DC
    • w32tm /query /status
    • w32tm /resync
    • w32tm /config /syncfromflags:manual /manualpeerlist: [lista]   , donde [lista] son los nombres DNS o IP de los servidores con los que se debe sincronizar, separados por comas
  • Get AD usuarios con un dato especifico
    • Get-ADUser -filter {employeeID -like “*” }| Get-ADObject -properties employeeid | Format-List name,employeeid
  • Actualizar un parametro con un CSV usuarios de AD
    • Import-CSV C:\test.csv | foreach { Set-ADUser $_.username -EmployeeID $_.id }
  • SQL Commands
  • IIS Commands enable Rastreo de procesos del Pool
    • cd C:\Windows\System32\inetsrv
    • appcmd list wp
    • appcmd list wps /apppool.name:DefaultAppPool
    • IIS 7.0 -> Root -> Worker Process “Procesos de Trabajo” -> Select -> ver solicitudes actuales
    • IIS 6.0 cscript iisapp.vbs
Advertisement

Comments»

1. Agenda de la Comunidad « MSExpertos - August 7, 2012

[…] Comandos Power Shell Utiles […]

2. baby products india - February 14, 2013

When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each
time a comment is added I get four emails with the same comment.
Is there any way you can remove people from that service?
Cheers!

3. http://vilmapalmaec.noticia.es/ - March 11, 2013

Howdy! This is my first visit to your blog! We
are a

group of volunteers and starting a new project in
a community in the same niche. Your blog

provided us valuable information to work on. You have done a

wonderful job!

4. reputation management firm - July 9, 2013

Just want to say your article is as surprising. The clarity in
your post is simply great and i could assume you’re an expert on this subject. Well with your permission allow me to grab your feed to keep up to date with forthcoming post. Thanks a million and please continue the rewarding work.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: